I am using the Common CLI for a personal project. One thing I didn't find from the documentation is that how to enforce a certain argument to present.
To clarify my question, can I define the different between argument and option, the command:
mycommand file.txt -b 2
mycommand is the command,
file.txt is the argument
-b 2 is the option where 2 is the option value
With Common CLI, I can add -b 2 as an option like this:
options.addOption( "b", true, "Some message" );
And parse the arguments using:
CommandLineParser commandParser = new GnuParser();
CommandLine result = commandParser.parse(options, args)
but how can I specify file.txt is also required?
Many thanks