Package org.jline.builtins
Class Options
java.lang.Object
org.jline.builtins.Options
A GNU-style long options parser that is configured by parsing its usage string.
This class provides a flexible command-line option parser that supports both short options (-a) and long options (--option), with or without arguments. The parser is configured by parsing a usage string that describes the available options and their arguments.
Features include:
- Support for both short (-a) and long (--option) options
- Required and optional option arguments
- Automatic generation of help text
- Support for subcommands
- Type conversion for option arguments
Code originally from Apache Felix Gogo Shell, adapted for JLine.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classException thrown when using the--helpoption on a built-in command. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionargs()static Optionsstatic Optionsstatic Optionsstatic Optionsstatic Optionsstatic OptionsintgetObjectList(String name) booleansetOptionsFirst(boolean optionsFirst) setStopOnBadOption(boolean stopOnBadOption) toString()usage()voidusage(PrintStream err) usageError(String s) Prints usage message and returns IllegalArgumentException, for you to throw.
-
Field Details
-
NL
-
-
Method Details
-
compile
-
compile
-
compile
-
compile
-
compile
-
compile
-
setStopOnBadOption
-
setOptionsFirst
-
isSet
-
getObject
-
getObjectList
-
getList
-
get
-
getNumber
-
argObjects
-
args
-
usage
-
usage
-
usageError
Prints usage message and returns IllegalArgumentException, for you to throw.- Parameters:
s- the message to display- Returns:
- an exception with the generated message
-
parse
-
parse
-
parse
-
parse
-
toString
-