You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by John Patrick <nh...@gmail.com> on 2016/10/13 14:25:09 UTC

Commons Cli Grouping Query

I'm having some issues working out if commons-cli out of the box can
handle my use case or if I'll need to handle it myself.

simply program, with a feature which at startup randomly decides if
it's enabled this execution. The feature can be specifically disabled
or enabled, but if enabled using the -yes switch, it has and optional
argument yesOptionalValue. If -yes is present then either -alpha or
-bravo is required but not both.

$ program [ -help | [ -no | [ -yes <yesOptionalValue> | [ -alpha
<alphaRequiredValue> | -bravo ] ] ] ]

hope that is understandable.

if think what I'm trying to achieve is beyond commons-cli.

e.g. full list of valid command lines
$ program -help
$ program -no
$ program -yes -alpha alphaValue
$ program -yes -bravo
$ program -yes optionalValue -alpha alphaValue
$ program -yes optionalValue -bravo

others combination are invalid.

cheers,
john

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org