Package io.github.qishr.cascara.common.util
Class ParserSpec
java.lang.Object
io.github.qishr.cascara.common.util.CommandLine.Model.ParserSpec
Enclosing Class:
io.github.qishr.cascara.common.util.CommandLine.Model
public static class ParserSpec
Models parser configuration specification.
Constructor Summary
| Constructor | Description |
|---|---|
| ParserSpec() |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
| public String | separator() | Returns the String to use as the separator between options and option parameters. |
| public boolean | stopAtUnmatched() | |
| public boolean | stopAtPositional() | |
| public String | endOfOptionsDelimiter() | |
| public boolean | toggleBooleanFlags() | |
| public boolean | overwrittenOptionsAllowed() | |
| public boolean | unmatchedArgumentsAllowed() | |
| public boolean | abbreviatedSubcommandsAllowed() | |
| public boolean | abbreviatedOptionsAllowed() | |
| public boolean | expandAtFiles() | |
| public Character | atFileCommentChar() | |
| public boolean | useSimplifiedAtFiles() | |
| public boolean | posixClusteredShortOptionsAllowed() | |
| public boolean | caseInsensitiveEnumValuesAllowed() | |
| public boolean | trimQuotes() | |
| public boolean | splitQuotedStrings() | |
| public boolean | unmatchedOptionsArePositionalParams() | |
| public boolean | unmatchedOptionsAllowedAsOptionParameters() | |
| public boolean | allowSubcommandsAsOptionParameters() | |
| public boolean | allowOptionsAsOptionParameters() | |
| 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. |
| public boolean | aritySatisfiedByAttachedOptionParam() | Returns true if options with attached arguments should not consume subsequent arguments and should not validate arity. |
| public boolean | collectErrors() | Returns true if exceptions during parsing should be collected instead of thrown. |
| public ParserSpec | separator(String separator) | Sets the String to use as the separator between options and option parameters. |
| public ParserSpec | stopAtUnmatched(boolean stopAtUnmatched) | |
| public ParserSpec | stopAtPositional(boolean stopAtPositional) | |
| public ParserSpec | endOfOptionsDelimiter(String delimiter) | |
| public ParserSpec | toggleBooleanFlags(boolean toggleBooleanFlags) | |
| public ParserSpec | overwrittenOptionsAllowed(boolean overwrittenOptionsAllowed) | |
| public ParserSpec | unmatchedArgumentsAllowed(boolean unmatchedArgumentsAllowed) | |
| public ParserSpec | abbreviatedSubcommandsAllowed(boolean abbreviatedSubcommandsAllowed) | |
| public ParserSpec | abbreviatedOptionsAllowed(boolean abbreviatedOptionsAllowed) | |
| public ParserSpec | expandAtFiles(boolean expandAtFiles) | |
| public ParserSpec | atFileCommentChar(Character atFileCommentChar) | |
| public ParserSpec | useSimplifiedAtFiles(boolean useSimplifiedAtFiles) | |
| public ParserSpec | posixClusteredShortOptionsAllowed(boolean posixClusteredShortOptionsAllowed) | |
| public ParserSpec | caseInsensitiveEnumValuesAllowed(boolean caseInsensitiveEnumValuesAllowed) | |
| public ParserSpec | trimQuotes(boolean trimQuotes) | |
| public ParserSpec | splitQuotedStrings(boolean splitQuotedStrings) | |
| public ParserSpec | unmatchedOptionsAllowedAsOptionParameters(boolean unmatchedOptionsAllowedAsOptionParameters) | |
| public ParserSpec | unmatchedOptionsArePositionalParams(boolean unmatchedOptionsArePositionalParams) | |
| public ParserSpec | allowSubcommandsAsOptionParameters(boolean allowSubcommandsAsOptionParameters) | |
| public ParserSpec | allowOptionsAsOptionParameters(boolean allowOptionsAsOptionParameters) | |
| public ParserSpec | collectErrors(boolean collectErrors) | Sets whether exceptions during parsing should be collected instead of thrown. |
| public ParserSpec | aritySatisfiedByAttachedOptionParam(boolean newValue) | Returns true if options with attached arguments should not consume subsequent arguments and should not validate arity. |
| public ParserSpec | limitSplit(boolean limitSplit) | Sets whether arguments should be split first before any further processing. |
| public String | toString() |
Method Details
separator
public String separator()
Returns the String to use as the separator between options and option parameters."=" by default,
initialized from Command.separator if defined.
stopAtUnmatched
public boolean stopAtUnmatched()
See Also:
stopAtPositional
public boolean stopAtPositional()
See Also:
endOfOptionsDelimiter
public String endOfOptionsDelimiter()
Since:
3.5
See Also:
toggleBooleanFlags
public boolean toggleBooleanFlags()
See Also:
overwrittenOptionsAllowed
public boolean overwrittenOptionsAllowed()
See Also:
unmatchedArgumentsAllowed
public boolean unmatchedArgumentsAllowed()
See Also:
abbreviatedSubcommandsAllowed
public boolean abbreviatedSubcommandsAllowed()
See Also:
isAbbreviatedSubcommandsAllowed
abbreviatedOptionsAllowed
public boolean abbreviatedOptionsAllowed()
See Also:
expandAtFiles
public boolean expandAtFiles()
See Also:
atFileCommentChar
public Character atFileCommentChar()
Since:
3.5
See Also:
useSimplifiedAtFiles
public boolean useSimplifiedAtFiles()
Since:
3.9
See Also:
posixClusteredShortOptionsAllowed
public boolean posixClusteredShortOptionsAllowed()
See Also:
isPosixClusteredShortOptionsAllowed
caseInsensitiveEnumValuesAllowed
public boolean caseInsensitiveEnumValuesAllowed()
Since:
3.4
See Also:
isCaseInsensitiveEnumValuesAllowed
trimQuotes
public boolean trimQuotes()
Since:
3.7
See Also:
splitQuotedStrings
public boolean splitQuotedStrings()
Since:
3.7
See Also:
unmatchedOptionsArePositionalParams
public boolean unmatchedOptionsArePositionalParams()
See Also:
isUnmatchedOptionsArePositionalParams
unmatchedOptionsAllowedAsOptionParameters
public boolean unmatchedOptionsAllowedAsOptionParameters()
Since:
4.4
See Also:
isUnmatchedOptionsAllowedAsOptionParameters
allowSubcommandsAsOptionParameters
public boolean allowSubcommandsAsOptionParameters()
Since:
4.7.8-SNAPSHOT
See Also:
isAllowSubcommandsAsOptionParameters
allowOptionsAsOptionParameters
public boolean allowOptionsAsOptionParameters()
Since:
4.7.8-SNAPSHOT
See Also:
isAllowOptionsAsOptionParameters
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 is false.
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 from ParseResult#errors().
Since:
3.2
separator
public ParserSpec separator(String separator)
Sets the String to use as the separator between options and option parameters.
Returns:
this ParserSpec for method chaining
stopAtUnmatched
public ParserSpec stopAtUnmatched(boolean stopAtUnmatched)
See Also:
stopAtPositional
public ParserSpec stopAtPositional(boolean stopAtPositional)
See Also:
endOfOptionsDelimiter
public ParserSpec endOfOptionsDelimiter(String delimiter)
Since:
3.5
See Also:
toggleBooleanFlags
public ParserSpec toggleBooleanFlags(boolean toggleBooleanFlags)
See Also:
overwrittenOptionsAllowed
public ParserSpec overwrittenOptionsAllowed(boolean overwrittenOptionsAllowed)
See Also:
unmatchedArgumentsAllowed
public ParserSpec unmatchedArgumentsAllowed(boolean unmatchedArgumentsAllowed)
See Also:
abbreviatedSubcommandsAllowed
public ParserSpec abbreviatedSubcommandsAllowed(boolean abbreviatedSubcommandsAllowed)
See Also:
setAbbreviatedSubcommandsAllowed
abbreviatedOptionsAllowed
public ParserSpec abbreviatedOptionsAllowed(boolean abbreviatedOptionsAllowed)
See Also:
expandAtFiles
public ParserSpec expandAtFiles(boolean expandAtFiles)
See Also:
atFileCommentChar
public ParserSpec atFileCommentChar(Character atFileCommentChar)
Since:
3.5
See Also:
useSimplifiedAtFiles
public ParserSpec useSimplifiedAtFiles(boolean useSimplifiedAtFiles)
Since:
3.9
See Also:
posixClusteredShortOptionsAllowed
public ParserSpec posixClusteredShortOptionsAllowed(boolean posixClusteredShortOptionsAllowed)
See Also:
setPosixClusteredShortOptionsAllowed
caseInsensitiveEnumValuesAllowed
public ParserSpec caseInsensitiveEnumValuesAllowed(boolean caseInsensitiveEnumValuesAllowed)
Since:
3.4
See Also:
setCaseInsensitiveEnumValuesAllowed
trimQuotes
public ParserSpec trimQuotes(boolean trimQuotes)
Since:
3.7
See Also:
splitQuotedStrings
public ParserSpec splitQuotedStrings(boolean splitQuotedStrings)
Since:
3.7
See Also:
unmatchedOptionsAllowedAsOptionParameters
public ParserSpec unmatchedOptionsAllowedAsOptionParameters(boolean unmatchedOptionsAllowedAsOptionParameters)
Since:
4.4
See Also:
setUnmatchedOptionsAllowedAsOptionParameters
unmatchedOptionsArePositionalParams
public ParserSpec unmatchedOptionsArePositionalParams(boolean unmatchedOptionsArePositionalParams)
See Also:
setUnmatchedOptionsArePositionalParams
allowSubcommandsAsOptionParameters
public ParserSpec allowSubcommandsAsOptionParameters(boolean allowSubcommandsAsOptionParameters)
Since:
4.7.8-SNAPSHOT
See Also:
setAllowSubcommandsAsOptionParameters
allowOptionsAsOptionParameters
public ParserSpec allowOptionsAsOptionParameters(boolean allowOptionsAsOptionParameters)
Since:
4.7.8-SNAPSHOT
See Also:
setAllowOptionsAsOptionParameters
collectErrors
public 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 from ParseResult#errors().
Since:
3.2
aritySatisfiedByAttachedOptionParam
public ParserSpec aritySatisfiedByAttachedOptionParam(boolean newValue)
Returns true if options with attached arguments should not consume subsequent arguments and should not validate arity.The default is false.
limitSplit
public 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.
toString
public String toString()