CliOptDefList extension

Extension methods to manipulate option definitions lists

on

Methods

findCliOptDef(String? name, {bool canThrow = false}) CliOptDef?
Find specific option definition by name
getCliOptDefsLongNames({bool isNegative = false}) List<String>
Get long names of all option definitions (positive or negative)
getCliOptDefsLongSubNames({bool isNegative = false}) List<String>
Get long sub-names of all option definitions (positive or negative)
getCliOptDefsShortNames() List<String>
Get short names of all option definitions
getCliOptDefsShortSubNames() List<String>
Get short sub-names of all option definitions
validateCliOptDefs(List<String> longNames, List<String> longSubNames, List<String> shortNames, List<String> shortSubNames) → void
Checks there is no long option or long sub-option consisting of short options and short sub-options
Throws an exception when such match found
Useful solely for the unit testing or a rare sanity check, as in release mode, the parser simply prefers long options over the bundled short ones

Static Methods

cliOptDefsFromString(String optDefStr, CliOptCaseMode caseMode) List<CliOptDef>
Create list from a single option definitions string