AnyArgParser class
Properties
-
allowsAnything
→ bool
-
Whether or not this parser treats unrecognized options as non-option
arguments.
no setter
-
allowTrailingOptions
→ bool
-
Whether or not this parser parses options that appear after non-option
arguments.
no setter
-
commands
→ Map<String, ArgParser>
-
The commands that have been defined for this parser.
no setter
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
options
→ Map<String, Option>
-
The options that have been defined for this parser.
no setter
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
usage
→ String
-
Generates a string displaying usage information for the defined options.
no setter
-
usageLineLength
→ int?
-
An optional maximum line length for usage messages.
no setter
Methods
-
addCommand(String name, [ArgParser? parser])
→ ArgParser
-
Defines a command.
-
addFlag(String name, {String? abbr, String? help, bool? defaultsTo = false, bool negatable = true, void callback(bool p1)?, bool hide = false, List<String> aliases = const []})
→ void
-
Defines a boolean flag.
-
addMultiOption(String name, {String? abbr, String? help, String? valueHelp, Iterable<String>? allowed, Map<String, String>? allowedHelp, Iterable<String>? defaultsTo, void callback(List<String> p1)?, bool splitCommas = true, bool hide = false, List<String> aliases = const []})
→ void
-
Defines an option that takes multiple values.
-
addOption(String name, {String? abbr, String? help, String? valueHelp, Iterable<String>? allowed, Map<String, String>? allowedHelp, String? defaultsTo, void callback(String? p1)?, bool mandatory = false, bool hide = false, List<String> aliases = const []})
→ void
-
Defines an option that takes a value.
-
addSeparator(String text)
→ void
-
Adds a separator line to the usage.
-
defaultFor(String option)
→ dynamic
-
Returns the default value for
option
.
-
findByAbbreviation(String abbr)
→ Option?
-
Finds the option whose abbreviation is
abbr
, or null
if no option has
that abbreviation.
-
findByNameOrAlias(String name)
→ Option?
-
Finds the option whose name or alias matches
name
, or null
if no
option has that name or alias.
-
getDefault(String option)
→ dynamic
-
-
inject(Option option)
→ void
-
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
parse(Iterable<String> args, {List<String> badArgs = const [], List<String>? preFlags})
→ ArgResults
-
Parses
args
, a list of command-line arguments, matches them against the
flags and options defined by this parser, and returns the result.
-
toString()
→ String
-
A string representation of this object.
inherited