Package net.emustudio.edigen.ui
Class CommandLine
- java.lang.Object
-
- net.emustudio.edigen.ui.CommandLine
-
public class CommandLine extends java.lang.ObjectThe command line argument parser.
-
-
Constructor Summary
Constructors Constructor Description CommandLine(Argument[] arguments)Constructs the command line parser for the given list of possible arguments, their types, etc.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Iterable<Argument>getMandatoryArguments()Returns a list of all expected mandatory arguments.java.lang.Iterable<Argument>getOptionalArguments()Returns a list of all possible optional arguments.java.util.Map<Setting,java.lang.String>parse(java.lang.String[] arguments)Parses the given argument list.
-
-
-
Constructor Detail
-
CommandLine
public CommandLine(Argument[] arguments)
Constructs the command line parser for the given list of possible arguments, their types, etc.- Parameters:
arguments- the argument specification
-
-
Method Detail
-
parse
public java.util.Map<Setting,java.lang.String> parse(java.lang.String[] arguments) throws CommandLineException
Parses the given argument list.- Parameters:
arguments- the argument list, as obtained from themain()method- Returns:
- the configuration object (a set of key-value pairs)
- Throws:
CommandLineException- when the arguments are invalid
-
getMandatoryArguments
public java.lang.Iterable<Argument> getMandatoryArguments()
Returns a list of all expected mandatory arguments.- Returns:
- the iterable list
-
getOptionalArguments
public java.lang.Iterable<Argument> getOptionalArguments()
Returns a list of all possible optional arguments.- Returns:
- the iterable list
-
-