Bug 1021528

Summary: ant does not accept targets starting by hyphen
Product: [Fedora] Fedora Reporter: Vít Ondruch <vondruch>
Component: antAssignee: Mikolaj Izdebski <mizdebsk>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: akurtako, java-sig-commits, jcapik, kdaniel, mizdebsk, mmatejov, msrb, tradej
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-21 13:20:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Vít Ondruch 2013-10-21 13:08:35 UTC
Description of problem:
I am trying to build target starting by hyphen by ant, but it fails unfortunately:

$ ant '-build-native-library'
Unknown argument: -build-native-library


Version-Release number of selected component (if applicable):
$ rpm -q ant
ant-1.9.2-7.fc21.noarch


How reproducible:
Always


Steps to Reproduce:
1. ant '-build-native-library'
2.
3.

Actual results:
$ ant '-build-native-library'
Unknown argument: -build-native-library


Expected results:
$ ant '-build-native-library'
...
building the target


Additional info:
I might be mistaken, but it should work according to: http://stackoverflow.com/questions/4256958/command-line-to-run-the-ant-task-with-hyphen-in-the-task-name

Comment 1 Vít Ondruch 2013-10-21 13:09:56 UTC
Please note that using double hyphen trick fails similarly:

$ ant -f build.xml -- -build-native-library
Unknown argument: --

Comment 2 Mikolaj Izdebski 2013-10-21 13:20:22 UTC
Targets beginning with a hyphen such as "-restart" are valid, and can be used to name targets that should not be called directly from the command line.

See upstream documentation: http://ant.apache.org/manual/targets.html