Is there a proper way of handling options using Apache Commons CLI without a hyphen? So instead of entering "-help" a normal "help" should also work? Or is this not possible/intended because an option would be no longer distinguishable from an argument?
1 Answer
Or is this not possible/intended because an option would be no longer distinguishable from an argument?
Absolutely, that's the reason. And all the libraries I know use the hyphen.
2 Comments
n1r3
Well, that's not exactly correct. It uses a mix, the second param is an action and then, you can have options, eg:
git commit -a -m "hello" and git commit -m "hello" -aAlex
It may be called an 'action,' but I think the point is that this a feature unfortunately not supported by Apache Commons CLI.