Module com.github.rvesse.airline
Class GreedyMaybeListValueOptionParser<T>
java.lang.Object
com.github.rvesse.airline.parser.AbstractParser<T>
com.github.rvesse.airline.parser.options.AbstractOptionParser<T>
com.github.rvesse.airline.parser.options.ListValueOptionParser<T>
com.github.rvesse.airline.parser.options.MaybeListValueOptionParser<T>
com.github.rvesse.airline.parser.options.GreedyMaybeListValueOptionParser<T>
- Type Parameters:
T
- Command Type
- All Implemented Interfaces:
OptionParser<T>
A variation on the
MaybeListValueOptionParser
that is greedy
This primarily makes a difference when used with commands that also use Arguments
or DefaultOption
.
If that is the case using this parser could incorrectly consume values not intended to be part of the list. Users
creating CLIs should be certain that this represents the behaviour they want.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canGreedySearch
(ParseState<T> state) Gets whether we can do a greedy search for list value(s)Methods inherited from class com.github.rvesse.airline.parser.options.MaybeListValueOptionParser
parseOptions
Methods inherited from class com.github.rvesse.airline.parser.options.ListValueOptionParser
getValues
Methods inherited from class com.github.rvesse.airline.parser.options.AbstractOptionParser
findOption, findOption, hasShortNamePrefix, isSeparatorOrOption, noValueForOption
Methods inherited from class com.github.rvesse.airline.parser.AbstractParser
getTypeConverter
-
Constructor Details
-
GreedyMaybeListValueOptionParser
public GreedyMaybeListValueOptionParser() -
GreedyMaybeListValueOptionParser
public GreedyMaybeListValueOptionParser(char separator)
-
-
Method Details
-
canGreedySearch
Description copied from class:MaybeListValueOptionParser
Gets whether we can do a greedy search for list value(s)- Overrides:
canGreedySearch
in classMaybeListValueOptionParser<T>
- Parameters:
state
- Parser State- Returns:
- True if a greedy search is permitted, false otherwise
-