The newParser method on CommandLineParserFactory is used to create command line parser instances.
Different applications may require different parsing implementation strategies. CLI ships with two implementations: PosixParser and GnuParser. Both of these implement the CommandLineParser interface.
The parser implementation is specified using the
org.apache.commons.cli.parser system property. This is set
to be the PosixParser
by default.
Now that a parser has been created the command line tokens can be
parsed. The two parse methods on
CommandLineParser
perform this task.