Args class abstract interface

Parsed CLI arguments with structured access to options and positionals.

Implemented types

Constructors

Args.parse(Iterable<String> input, {Map<String, Object?>? defaults, Map<String, String>? aliases, Iterable<String>? bool, Iterable<String>? string, Iterable<String>? list})
Parses raw CLI input into a structured argument tree.
factory

Properties

args Iterable<Object?>
Positional arguments with basic type coercion applied.
no setter
hashCode int
The hash code for this object.
no setterinherited
rest Iterable<String>
Positional arguments that were not parsed as options.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value Map<String, Argv>
The wrapped value.
finalinherited

Methods

as<R>() → R
Casts value to R.
inherited
at(String name) Argv?
Looks up an option by name.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
safeAs<R>() → R?
Casts value to R if possible, otherwise returns null.
inherited
toJson() Map<String, Object>
Returns a JSON-friendly map representation.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](String name) Argv?
Shorthand for at.