Package is.hi.bok.deduplicator
Class CommandLineParser
- java.lang.Object
-
- is.hi.bok.deduplicator.CommandLineParser
-
public class CommandLineParser extends Object
Print DigestIndexer command-line usage message.- Author:
- Kristinn Sigurðsson
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
CommandLineParser.DigestHelpFormatter
Override so can customize usage output.
-
Constructor Summary
Constructors Constructor Description CommandLineParser(String[] args, PrintWriter out)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
CommandLineParser
public CommandLineParser(String[] args, PrintWriter out) throws org.apache.commons.cli.ParseException
Constructor.- Parameters:
args
- Command-line arguments to process.out
- PrintStream to write on.- Throws:
org.apache.commons.cli.ParseException
- Failed parse of command line.
-
-
Method Detail
-
usage
public void usage()
Print usage then exit.
-
usage
public void usage(int exitCode)
Print usage then exit.- Parameters:
exitCode
-
-
usage
public void usage(String message, int exitCode)
Print message then usage then exit.The JVM exits inside in this method.
- Parameters:
message
- Message to print before we do usage.exitCode
- Exit code to use in call to System.exit.
-
message
public void message(String message, int exitCode)
Print message and then exit.The JVM exits inside in this method.
- Parameters:
message
- Message to print before we do usage.exitCode
- Exit code to use in call to System.exit.
-
getCommandLineOptions
public org.apache.commons.cli.Option[] getCommandLineOptions()
- Returns:
- Options passed on the command line.
-
getCommandLineArguments
public List getCommandLineArguments()
- Returns:
- Arguments passed on the command line.
-
getCommandLine
public org.apache.commons.cli.CommandLine getCommandLine()
- Returns:
- Command line.
-
-