java.lang.Object
io.github.mmm.cli.arg.CliArgument
io.github.mmm.cli.arg.CliOption
- Direct Known Subclasses:
CliLongOption,CliShortOption
- Since:
- 1.0.0
-
Field Summary
Fields inherited from class io.github.mmm.cli.arg.CliArgument
END_OPTIONS -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class io.github.mmm.cli.arg.CliArgument
get, getNext, getNextOption, getNextValue, getOptionName, getValue, getValues, isLongOption, isShortOption, toString
-
Constructor Details
-
CliOption
The constructor.- Parameters:
arg- theargument option.assignment- - theassignmentflag.
-
-
Method Details
-
isAssignment
public boolean isAssignment()- Returns:
trueif this option was provided with a value assignment (e.g. "--file=test.txt" forCliLongOption"--file"),falseotherwise (e.g. "--file test.txt").
-
isOption
public boolean isOption()- Specified by:
isOptionin classCliArgument- Returns:
trueif thisCliArgumentis aCliOption(e.g. "-h" or "--help"),falseotherwise (if it is aCliValue).
-
isValue
public boolean isValue()- Specified by:
isValuein classCliArgument- Returns:
trueif thisCliArgumentis aCliValue,falseotherwise (if it is aCliOption).
-
getValueType
- Specified by:
getValueTypein classCliArgument- Returns:
- the
CliValueTypeornullin case of anoption.
-
isEndOptions
public boolean isEndOptions()- Overrides:
isEndOptionsin classCliArgument- Returns:
trueifCliArgument.END_OPTIONSwas detected,falseotherwise. IfCliArgument.END_OPTIONSis parsed for the first time, it will be skipped, all following arguments will be parsed asCliValueno matter if they start with hyphen ('-') or not and will returntruefor this method.
-