public class CommandLineParser extends Object
Modifier and Type | Class and Description |
---|---|
class |
CommandLineParser.DigestHelpFormatter
Override so can customize usage output.
|
Constructor and Description |
---|
CommandLineParser(String[] args,
PrintWriter out)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
org.apache.commons.cli.CommandLine |
getCommandLine() |
List |
getCommandLineArguments() |
org.apache.commons.cli.Option[] |
getCommandLineOptions() |
void |
message(String message,
int exitCode)
Print message and then exit.
|
void |
usage()
Print usage then exit.
|
void |
usage(int exitCode)
Print usage then exit.
|
void |
usage(String message,
int exitCode)
Print message then usage then exit.
|
public CommandLineParser(String[] args, PrintWriter out) throws org.apache.commons.cli.ParseException
args
- Command-line arguments to process.out
- PrintStream to write on.org.apache.commons.cli.ParseException
- Failed parse of command line.public void usage()
public void usage(int exitCode)
exitCode
- public void usage(String message, int exitCode)
The JVM exits inside in this method.
message
- Message to print before we do usage.exitCode
- Exit code to use in call to System.exit.public void message(String message, int exitCode)
The JVM exits inside in this method.
message
- Message to print before we do usage.exitCode
- Exit code to use in call to System.exit.public org.apache.commons.cli.Option[] getCommandLineOptions()
public List getCommandLineArguments()
public org.apache.commons.cli.CommandLine getCommandLine()
Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.