Bug 1021528 - ant does not accept targets starting by hyphen
Summary: ant does not accept targets starting by hyphen
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: ant
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mikolaj Izdebski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-21 13:08 UTC by Vít Ondruch
Modified: 2013-10-21 13:20 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-21 13:20:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.