CliOptName extension

Extension to String for command-line option name manipulations

on

Methods

addPrefix({bool isPositive = true}) String
Prepend option name with prefix depending on flag isPositive
getCliOptName(CliOptCaseMode caseMode, {bool withPrefix = false}) String
Removes all unwanted characters from the given string and convert case depending on mode specified
getCliOptStopMode() CliOptStopMode
Checks whether the given string represents a kind of a flag indicating there is no more option name to expect
isCliOptNameShort() bool
Returns true of the string represents potential short option name
isCliOptNameValid([CliOptStopMode stopMode = CliOptStopMode.none]) bool
Checks whether the string can be treated as an option name
isCliOptPositive() bool
Returns true if the string starts with prefix
isCliOptStopMode() bool
Returns true if the string represents any kind of an 'end-of-options'
isCliSubCmdValid() bool
Checks whether the string can be treated as an option name
shrinkCliOptName({bool withPrefix = false}) String
Removes all unwanted characters from the given string
splitCliOptNameValue() List<String>
Breaks the string into an option name and value (without unbundling)
toFullCliOptName(bool isPositive) String
Prepends option name with prefix depending on isPositive
toLowerCliOptName(CliOptCaseMode caseMode) String
Converts the string to lower depending on case mode

Static Properties

negPrefix String
Constant for the standard negative option name prefix
final
prefix String
Constant for the standard option name prefix
final