Class SimpleCommandLineParser
- java.lang.Object
-
- de.gebit.integrity.runner.console.SimpleCommandLineParser
-
public class SimpleCommandLineParser extends java.lang.Object
A very simple command line parser.- Author:
- Rene Schneider - initial API and implementation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SimpleCommandLineParser.BooleanOption
A boolean command line option.static class
SimpleCommandLineParser.DecimalOption
Decimal option.static class
SimpleCommandLineParser.IntegerOption
Integer option.static class
SimpleCommandLineParser.LongOption
Long option.static class
SimpleCommandLineParser.Option
Base class for command line options.static class
SimpleCommandLineParser.StringOption
String option.static class
SimpleCommandLineParser.ValueOption<X>
A base class for an option that has one or more values.
-
Constructor Summary
Constructors Constructor Description SimpleCommandLineParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addOptions(SimpleCommandLineParser.Option... someOptions)
Add one or more options.java.lang.String
getHelp(java.lang.String aRemainingParamsHelp)
Creates a help message to print out on the command line, based on the command line options registered.java.lang.String[]
parseAndReturnRemaining(java.lang.String[] someParameters)
Parses the given parameters and returns all parameters that could not be matched.
-
-
-
Method Detail
-
addOptions
public void addOptions(SimpleCommandLineParser.Option... someOptions)
Add one or more options.- Parameters:
someOptions
-
-
parseAndReturnRemaining
public java.lang.String[] parseAndReturnRemaining(java.lang.String[] someParameters) throws java.lang.IllegalArgumentException
Parses the given parameters and returns all parameters that could not be matched.- Parameters:
someParameters
- the parameters to parse- Returns:
- the remaining unmatched parameters
- Throws:
java.lang.IllegalArgumentException
-
getHelp
public java.lang.String getHelp(java.lang.String aRemainingParamsHelp)
Creates a help message to print out on the command line, based on the command line options registered.- Parameters:
aRemainingParamsHelp
- the text to attach at the end of the "command line"- Returns:
- the help message string
-
-