Package net.ontopia.utils
Class CmdlineOptions
java.lang.Object
net.ontopia.utils.CmdlineOptions
INTERNAL: A class that parses command line options.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceINTERNAL: A listener interface that must be implemented by object that are interested in options found by the CmdlineOptions instance.static classINTERNAL: An exception that is thrown when there are problems with the options specified on the command line. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected String[]protected List<gnu.getopt.LongOpt>protected Map<Integer,CmdlineOptions.ListenerIF> protected StringBuilder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLong(CmdlineOptions.ListenerIF listener, String name, char c) Add a long argumentless option with the specified listener.voidaddLong(CmdlineOptions.ListenerIF listener, String name, char c, boolean req_arg) Add a long option with argument with the specified listener.voidaddShort(CmdlineOptions.ListenerIF listener, char c) Add a short argumentless option with the specified listener.voidaddShort(CmdlineOptions.ListenerIF listener, char c, boolean req_arg) Add a short option with argument with the specified listener.String[]Return non-option arguments that are remaining after parsing the command line arguments.voidparse()Parse the command line arguments and notify option listeners.
-
Field Details
-
application
-
argv
-
sargs
-
largs
-
listeners
-
arguments
-
-
Constructor Details
-
CmdlineOptions
-
-
Method Details
-
addShort
Add a short argumentless option with the specified listener. -
addShort
Add a short option with argument with the specified listener. -
addLong
Add a long argumentless option with the specified listener. -
addLong
Add a long option with argument with the specified listener. -
parse
Parse the command line arguments and notify option listeners.- Throws:
CmdlineOptions.OptionsException
-
getArguments
Return non-option arguments that are remaining after parsing the command line arguments.
-