Option class Null safety

A command-line option.

This represents both boolean flags and options which take a value.

Properties

abbr String?
A single-character string that can be used as a shorthand for this option. [...]
final
aliases List<String>
All aliases for name.
final
allowed List<String>?
A list of valid values for this option.
final
allowedHelp Map<String, String>?
A map from values in allowed to documentation for those values.
final
callback Function?
The callback to invoke with the option's value when the option is parsed.
final
defaultsTo → dynamic
The value this option will have if the user doesn't explicitly pass it.
final
hashCode int
The hash code for this object. [...]
read-only, inherited
help String?
A description of this option.
final
hide bool
Whether this option should be hidden from usage documentation.
final
isFlag bool
Whether the option is boolean-valued flag.
read-only
isMultiple bool
Whether the option allows multiple values.
read-only
isSingle bool
Whether the option takes a single value.
read-only
mandatory bool
Whether this option must be provided for correct usage.
final
name String
The name of the option that the user passes as an argument.
final
negatable bool?
Whether this flag's value can be set to false. [...]
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
splitCommas bool
Whether multiple values may be passed by writing --option a,b in addition to --option a --option b.
final
type OptionType
Whether this is a flag, a single value option, or a multi-value option.
final
valueHelp String?
A name for the value this option takes.
final

Methods

getOrDefault(dynamic value) → dynamic
@Deprecated('Use valueOrDefault instead.')
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited
valueOrDefault(dynamic value) → dynamic
Returns value if non-null, otherwise returns the default value for this option. [...]

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited