3

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 1

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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" -a
It may be called an 'action,' but I think the point is that this a feature unfortunately not supported by Apache Commons CLI.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.