Package picocli
Class CommandLine.Model.ParserSpec
- java.lang.Object
-
- picocli.CommandLine.Model.ParserSpec
-
- Enclosing class:
- CommandLine.Model
public static class CommandLine.Model.ParserSpec extends java.lang.Object
Models parser configuration specification.- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
abbreviatedOptionsAllowed
private boolean
abbreviatedSubcommandsAllowed
private boolean
aritySatisfiedByAttachedOptionParam
private java.lang.Character
atFileCommentChar
private boolean
caseInsensitiveEnumValuesAllowed
private boolean
collectErrors
(package private) static java.lang.String
DEFAULT_END_OF_OPTIONS_DELIMITER
(package private) static java.lang.String
DEFAULT_SEPARATOR
Constant String holding the default separator between options and option parameters:"="
.private java.lang.String
endOfOptionsDelimiter
private boolean
expandAtFiles
private boolean
limitSplit
private boolean
overwrittenOptionsAllowed
private boolean
posixClusteredShortOptionsAllowed
private java.lang.String
separator
private boolean
splitQuotedStrings
private boolean
stopAtPositional
private boolean
stopAtUnmatched
private boolean
toggleBooleanFlags
private boolean
trimQuotes
private boolean
unmatchedArgumentsAllowed
private boolean
unmatchedOptionsAllowedAsOptionParameters
private boolean
unmatchedOptionsArePositionalParams
private boolean
useSimplifiedAtFiles
-
Constructor Summary
Constructors Constructor Description ParserSpec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
abbreviatedOptionsAllowed()
CommandLine.Model.ParserSpec
abbreviatedOptionsAllowed(boolean abbreviatedOptionsAllowed)
boolean
abbreviatedSubcommandsAllowed()
CommandLine.Model.ParserSpec
abbreviatedSubcommandsAllowed(boolean abbreviatedSubcommandsAllowed)
boolean
aritySatisfiedByAttachedOptionParam()
Returns true if options with attached arguments should not consume subsequent arguments and should not validate arity.CommandLine.Model.ParserSpec
aritySatisfiedByAttachedOptionParam(boolean newValue)
Returns true if options with attached arguments should not consume subsequent arguments and should not validate arity.java.lang.Character
atFileCommentChar()
CommandLine.Model.ParserSpec
atFileCommentChar(java.lang.Character atFileCommentChar)
boolean
caseInsensitiveEnumValuesAllowed()
CommandLine.Model.ParserSpec
caseInsensitiveEnumValuesAllowed(boolean caseInsensitiveEnumValuesAllowed)
boolean
collectErrors()
Returns true if exceptions during parsing should be collected instead of thrown.CommandLine.Model.ParserSpec
collectErrors(boolean collectErrors)
Sets whether exceptions during parsing should be collected instead of thrown.java.lang.String
endOfOptionsDelimiter()
CommandLine.Model.ParserSpec
endOfOptionsDelimiter(java.lang.String delimiter)
boolean
expandAtFiles()
CommandLine.Model.ParserSpec
expandAtFiles(boolean expandAtFiles)
(package private) void
initFrom(CommandLine.Model.ParserSpec settings)
(package private) void
initSeparator(java.lang.String value)
boolean
limitSplit()
Returns true if arguments should be split first before any further processing and the number of parts resulting from the split is limited to the max arity of the argument.CommandLine.Model.ParserSpec
limitSplit(boolean limitSplit)
Sets whether arguments should be split first before any further processing.boolean
overwrittenOptionsAllowed()
CommandLine.Model.ParserSpec
overwrittenOptionsAllowed(boolean overwrittenOptionsAllowed)
boolean
posixClusteredShortOptionsAllowed()
CommandLine.Model.ParserSpec
posixClusteredShortOptionsAllowed(boolean posixClusteredShortOptionsAllowed)
java.lang.String
separator()
Returns the String to use as the separator between options and option parameters.CommandLine.Model.ParserSpec
separator(java.lang.String separator)
Sets the String to use as the separator between options and option parameters.private boolean
shouldTrimQuotes()
private boolean
splitFirst()
boolean
splitQuotedStrings()
CommandLine.Model.ParserSpec
splitQuotedStrings(boolean splitQuotedStrings)
boolean
stopAtPositional()
CommandLine.Model.ParserSpec
stopAtPositional(boolean stopAtPositional)
boolean
stopAtUnmatched()
CommandLine.Model.ParserSpec
stopAtUnmatched(boolean stopAtUnmatched)
boolean
toggleBooleanFlags()
CommandLine.Model.ParserSpec
toggleBooleanFlags(boolean toggleBooleanFlags)
java.lang.String
toString()
boolean
trimQuotes()
CommandLine.Model.ParserSpec
trimQuotes(boolean trimQuotes)
boolean
unmatchedArgumentsAllowed()
CommandLine.Model.ParserSpec
unmatchedArgumentsAllowed(boolean unmatchedArgumentsAllowed)
boolean
unmatchedOptionsAllowedAsOptionParameters()
CommandLine.Model.ParserSpec
unmatchedOptionsAllowedAsOptionParameters(boolean unmatchedOptionsAllowedAsOptionParameters)
boolean
unmatchedOptionsArePositionalParams()
CommandLine.Model.ParserSpec
unmatchedOptionsArePositionalParams(boolean unmatchedOptionsArePositionalParams)
(package private) void
updateSeparator(java.lang.String value)
boolean
useSimplifiedAtFiles()
CommandLine.Model.ParserSpec
useSimplifiedAtFiles(boolean useSimplifiedAtFiles)
-
-
-
Field Detail
-
DEFAULT_SEPARATOR
static final java.lang.String DEFAULT_SEPARATOR
Constant String holding the default separator between options and option parameters:"="
.- See Also:
- Constant Field Values
-
DEFAULT_END_OF_OPTIONS_DELIMITER
static final java.lang.String DEFAULT_END_OF_OPTIONS_DELIMITER
- See Also:
- Constant Field Values
-
abbreviatedOptionsAllowed
private boolean abbreviatedOptionsAllowed
-
abbreviatedSubcommandsAllowed
private boolean abbreviatedSubcommandsAllowed
-
aritySatisfiedByAttachedOptionParam
private boolean aritySatisfiedByAttachedOptionParam
-
atFileCommentChar
private java.lang.Character atFileCommentChar
-
caseInsensitiveEnumValuesAllowed
private boolean caseInsensitiveEnumValuesAllowed
-
collectErrors
private boolean collectErrors
-
endOfOptionsDelimiter
private java.lang.String endOfOptionsDelimiter
-
expandAtFiles
private boolean expandAtFiles
-
limitSplit
private boolean limitSplit
-
overwrittenOptionsAllowed
private boolean overwrittenOptionsAllowed
-
posixClusteredShortOptionsAllowed
private boolean posixClusteredShortOptionsAllowed
-
separator
private java.lang.String separator
-
splitQuotedStrings
private boolean splitQuotedStrings
-
stopAtPositional
private boolean stopAtPositional
-
stopAtUnmatched
private boolean stopAtUnmatched
-
toggleBooleanFlags
private boolean toggleBooleanFlags
-
trimQuotes
private boolean trimQuotes
-
unmatchedArgumentsAllowed
private boolean unmatchedArgumentsAllowed
-
unmatchedOptionsAllowedAsOptionParameters
private boolean unmatchedOptionsAllowedAsOptionParameters
-
unmatchedOptionsArePositionalParams
private boolean unmatchedOptionsArePositionalParams
-
useSimplifiedAtFiles
private boolean useSimplifiedAtFiles
-
-
Method Detail
-
separator
public java.lang.String separator()
Returns the String to use as the separator between options and option parameters."="
by default, initialized fromCommandLine.Command.separator()
if defined.
-
stopAtUnmatched
public boolean stopAtUnmatched()
- See Also:
CommandLine.isStopAtUnmatched()
-
stopAtPositional
public boolean stopAtPositional()
- See Also:
CommandLine.isStopAtPositional()
-
endOfOptionsDelimiter
public java.lang.String endOfOptionsDelimiter()
- Since:
- 3.5
- See Also:
CommandLine.getEndOfOptionsDelimiter()
-
toggleBooleanFlags
public boolean toggleBooleanFlags()
- See Also:
CommandLine.isToggleBooleanFlags()
-
overwrittenOptionsAllowed
public boolean overwrittenOptionsAllowed()
-
unmatchedArgumentsAllowed
public boolean unmatchedArgumentsAllowed()
-
abbreviatedSubcommandsAllowed
public boolean abbreviatedSubcommandsAllowed()
-
abbreviatedOptionsAllowed
public boolean abbreviatedOptionsAllowed()
-
expandAtFiles
public boolean expandAtFiles()
- See Also:
CommandLine.isExpandAtFiles()
-
atFileCommentChar
public java.lang.Character atFileCommentChar()
- Since:
- 3.5
- See Also:
CommandLine.getAtFileCommentChar()
-
useSimplifiedAtFiles
public boolean useSimplifiedAtFiles()
- Since:
- 3.9
- See Also:
CommandLine.isUseSimplifiedAtFiles()
-
posixClusteredShortOptionsAllowed
public boolean posixClusteredShortOptionsAllowed()
-
caseInsensitiveEnumValuesAllowed
public boolean caseInsensitiveEnumValuesAllowed()
- Since:
- 3.4
- See Also:
CommandLine.isCaseInsensitiveEnumValuesAllowed()
-
trimQuotes
public boolean trimQuotes()
- Since:
- 3.7
- See Also:
CommandLine.isTrimQuotes()
-
splitQuotedStrings
public boolean splitQuotedStrings()
- Since:
- 3.7
- See Also:
CommandLine.isSplitQuotedStrings()
-
unmatchedOptionsArePositionalParams
public boolean unmatchedOptionsArePositionalParams()
-
unmatchedOptionsAllowedAsOptionParameters
public boolean unmatchedOptionsAllowedAsOptionParameters()
- Since:
- 4.4
- See Also:
CommandLine.isUnmatchedOptionsAllowedAsOptionParameters()
-
splitFirst
private boolean splitFirst()
-
limitSplit
public boolean limitSplit()
Returns true if arguments should be split first before any further processing and the number of parts resulting from the split is limited to the max arity of the argument.
-
aritySatisfiedByAttachedOptionParam
public boolean aritySatisfiedByAttachedOptionParam()
Returns true if options with attached arguments should not consume subsequent arguments and should not validate arity. The default isfalse
.
-
collectErrors
public boolean collectErrors()
Returns true if exceptions during parsing should be collected instead of thrown. Multiple errors may be encountered during parsing. These can be obtained fromCommandLine.ParseResult.errors()
.- Since:
- 3.2
-
separator
public CommandLine.Model.ParserSpec separator(java.lang.String separator)
Sets the String to use as the separator between options and option parameters.- Returns:
- this ParserSpec for method chaining
-
stopAtUnmatched
public CommandLine.Model.ParserSpec stopAtUnmatched(boolean stopAtUnmatched)
- See Also:
CommandLine.setStopAtUnmatched(boolean)
-
stopAtPositional
public CommandLine.Model.ParserSpec stopAtPositional(boolean stopAtPositional)
- See Also:
CommandLine.setStopAtPositional(boolean)
-
endOfOptionsDelimiter
public CommandLine.Model.ParserSpec endOfOptionsDelimiter(java.lang.String delimiter)
- Since:
- 3.5
- See Also:
CommandLine.setEndOfOptionsDelimiter(String)
-
toggleBooleanFlags
public CommandLine.Model.ParserSpec toggleBooleanFlags(boolean toggleBooleanFlags)
-
overwrittenOptionsAllowed
public CommandLine.Model.ParserSpec overwrittenOptionsAllowed(boolean overwrittenOptionsAllowed)
-
unmatchedArgumentsAllowed
public CommandLine.Model.ParserSpec unmatchedArgumentsAllowed(boolean unmatchedArgumentsAllowed)
-
abbreviatedSubcommandsAllowed
public CommandLine.Model.ParserSpec abbreviatedSubcommandsAllowed(boolean abbreviatedSubcommandsAllowed)
-
abbreviatedOptionsAllowed
public CommandLine.Model.ParserSpec abbreviatedOptionsAllowed(boolean abbreviatedOptionsAllowed)
-
expandAtFiles
public CommandLine.Model.ParserSpec expandAtFiles(boolean expandAtFiles)
- See Also:
CommandLine.setExpandAtFiles(boolean)
-
atFileCommentChar
public CommandLine.Model.ParserSpec atFileCommentChar(java.lang.Character atFileCommentChar)
- Since:
- 3.5
- See Also:
CommandLine.setAtFileCommentChar(Character)
-
useSimplifiedAtFiles
public CommandLine.Model.ParserSpec useSimplifiedAtFiles(boolean useSimplifiedAtFiles)
- Since:
- 3.9
- See Also:
CommandLine.setUseSimplifiedAtFiles(boolean)
-
posixClusteredShortOptionsAllowed
public CommandLine.Model.ParserSpec posixClusteredShortOptionsAllowed(boolean posixClusteredShortOptionsAllowed)
-
caseInsensitiveEnumValuesAllowed
public CommandLine.Model.ParserSpec caseInsensitiveEnumValuesAllowed(boolean caseInsensitiveEnumValuesAllowed)
- Since:
- 3.4
- See Also:
CommandLine.setCaseInsensitiveEnumValuesAllowed(boolean)
-
trimQuotes
public CommandLine.Model.ParserSpec trimQuotes(boolean trimQuotes)
- Since:
- 3.7
- See Also:
CommandLine.setTrimQuotes(boolean)
-
splitQuotedStrings
public CommandLine.Model.ParserSpec splitQuotedStrings(boolean splitQuotedStrings)
- Since:
- 3.7
- See Also:
CommandLine.setSplitQuotedStrings(boolean)
-
unmatchedOptionsAllowedAsOptionParameters
public CommandLine.Model.ParserSpec unmatchedOptionsAllowedAsOptionParameters(boolean unmatchedOptionsAllowedAsOptionParameters)
- Since:
- 4.4
- See Also:
CommandLine.setUnmatchedOptionsAllowedAsOptionParameters(boolean)
-
unmatchedOptionsArePositionalParams
public CommandLine.Model.ParserSpec unmatchedOptionsArePositionalParams(boolean unmatchedOptionsArePositionalParams)
-
collectErrors
public CommandLine.Model.ParserSpec collectErrors(boolean collectErrors)
Sets whether exceptions during parsing should be collected instead of thrown. Multiple errors may be encountered during parsing. These can be obtained fromCommandLine.ParseResult.errors()
.- Since:
- 3.2
-
aritySatisfiedByAttachedOptionParam
public CommandLine.Model.ParserSpec aritySatisfiedByAttachedOptionParam(boolean newValue)
Returns true if options with attached arguments should not consume subsequent arguments and should not validate arity. The default isfalse
.
-
limitSplit
public CommandLine.Model.ParserSpec limitSplit(boolean limitSplit)
Sets whether arguments should be split first before any further processing. If true, the original argument will only be split into as many parts as allowed by max arity.
-
shouldTrimQuotes
private boolean shouldTrimQuotes()
-
initSeparator
void initSeparator(java.lang.String value)
-
updateSeparator
void updateSeparator(java.lang.String value)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
initFrom
void initFrom(CommandLine.Model.ParserSpec settings)
-
-