public interface CmdLineParser
Implementations of this interface are intended to be passed to the constructor of a CmdLineHandler, which will then use the implementation to parse the command line to its composite elements.
Information on using CmdLineParsers can be found in the jcmdline User Guide.
Modifier and Type | Method and Description |
---|---|
UsageFormatter |
getUsageFormatter()
Gets a usage formatter suitable for this CmdLineParser's format.
|
void |
parse(String[] clargs,
Map<String,Parameter<?>> opts,
List<Parameter<?>> args)
Parses the passed command line arguments into sets of options and
arguments.
|
void |
setUsageFormatter(UsageFormatter usageFormatter)
Sets a usage formatter suitable for this CmdLineParser's format.
|
UsageFormatter getUsageFormatter()
setUsageFormatter()
void parse(String[] clargs, Map<String,Parameter<?>> opts, List<Parameter<?>> args) throws CmdLineException
clargs
- the command line argumentsopts
- the expected command line optionsargs
- the expected command line arguments (what is left on the
command line after the options have been processed.CmdLineException
- if the clargs
fail to parse properly into the
expected options and arguments.void setUsageFormatter(UsageFormatter usageFormatter)
usageFormatter
- a usage formatter suitable for this CmdLineParser's formatgetUsageFormatter()
Copyright © 2017. All rights reserved.