kohsuke/args4j

Can't specify an option without the hyphen

epatpol opened this issue · 3 comments

Maybe it's simply not supported but can I specify an option without the hyphen? I have a program foo and I would like to call methods like :

foo sync
foo get X
foo push X
foo update
foo replace X Y

Are those possible with args4j? The way I see it right now I have to use arguments with this but I'm not sure it's that simple...

Thank you!

I believe the whole point of the project is to mimic *nix command line behavior, and to do so, an argument needs to be matched up with its property. so if you want to supply a name you use "-name" and then the value for that name-value pair follows.

Otherwise, there wouldn't be a way for the system to know what variable is supposed to be set to "replace".

If your intention was to have subcommands like in git/svn, then this is now supported -

http://args4j.kohsuke.org/args4j/apidocs/org/kohsuke/args4j/spi/SubCommandHandler.html

Thanks for the update @kasunbg. I ended up hardcoding the options myself but it's nice to know that it's now supported!