Package org.apache.felix.gogo.options
Class Options
java.lang.Object
org.apache.felix.gogo.options.Options
- All Implemented Interfaces:
Option
Yet another GNU long options parser. This one is configured by parsing its Usage string.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionget remaining non-options args as Objects.args()
get remaining non-options args as Strings.static Option
static Option
static Option
static Option
get value of named option.get list of all values for named option.int
get value of named option as a Number.get value of named option as an Object.getObjectList
(String name) get list of all Object values for named option.boolean
test whether specified option has been explicitly set.static void
parse arguments.parse arguments.parse arguments.parse arguments.setOptionsFirst
(boolean optionsFirst) require options to precede args.setStopOnBadOption
(boolean stopOnBadOption) stop parsing on the first unknown option.toString()
void
usage()
print usage message to System.err.usageError
(String s) prints usage message and returns IllegalArgumentException, for you to throw.
-
Field Details
-
NL
-
-
Method Details
-
main
-
compile
-
compile
-
compile
-
compile
-
setStopOnBadOption
Description copied from interface:Option
stop parsing on the first unknown option. This allows one parser to get its own options and then pass the remaining options to another parser.- Specified by:
setStopOnBadOption
in interfaceOption
- Parameters:
stopOnBadOption
-
-
setOptionsFirst
Description copied from interface:Option
require options to precede args. Default is false, so options can appear between or after args.- Specified by:
setOptionsFirst
in interfaceOption
- Parameters:
optionsFirst
-
-
isSet
Description copied from interface:Option
test whether specified option has been explicitly set. -
getObject
Description copied from interface:Option
get value of named option as an Object. If multiple options given, this method returns the last one. UseOption.getObjectList(String)
to get all values. -
getObjectList
Description copied from interface:Option
get list of all Object values for named option.- Specified by:
getObjectList
in interfaceOption
- Parameters:
name
-- Returns:
-
getList
Description copied from interface:Option
get list of all values for named option. -
get
Description copied from interface:Option
get value of named option. If multiple options given, this method returns the last one. UseOption.getList(String)
to get all values. -
getNumber
Description copied from interface:Option
get value of named option as a Number. -
argObjects
Description copied from interface:Option
get remaining non-options args as Objects.- Specified by:
argObjects
in interfaceOption
- Returns:
-
args
Description copied from interface:Option
get remaining non-options args as Strings. -
usage
public void usage()Description copied from interface:Option
print usage message to System.err. -
usageError
prints usage message and returns IllegalArgumentException, for you to throw.- Specified by:
usageError
in interfaceOption
- Parameters:
s
-- Returns:
- IllegalArgumentException
-
parse
Description copied from interface:Option
parse arguments. -
parse
Description copied from interface:Option
parse arguments. -
parse
Description copied from interface:Option
parse arguments. -
parse
Description copied from interface:Option
parse arguments. If skipArgv0 is true, then parsing begins at arg1. This allows for commands where argv0 is the command name rather than a real argument. -
toString
-