I'm trying JCommander for the first time and I can't seem to adjust it to my needs.
I am trying to define a CLI similar in concept to that of the grep
command:
command [options] PATTERN [FILE ...]
Usage example:
command -debug "[A-Z]*" *.xml
But, JCommander does not allow more than one "Main" parameter, so I cannot define both PATTERN
and FILE
as main parameters - which means I need to do something like:
command -debug -p "[A-Z]*" *.xml
- meaning to include the pattern as an option (-p "[A-Z]*"
)
My question - is there a way around this, or should I consider another solution instead of JCommander?