Command class

Constructors

Command({String? script, String? description, List<Param> requiredParams = const [], List<Param> optionalParams = const [], bool override = false, Map<String, Command> switches = const {}, String? defaultSwitch, String? flags})
const

Properties

commandText String
Backward compatibility: alias for script
no setter
defaultSwitch String?
Default switch to use when no switch is specified Can be either:
final
description String?
Optional description for help text
final
flags String?
Optional flags/aliases for this command when used as a switch Example: "-s, --stg" for staging switch
final
hashCode int
The hash code for this object.
no setterinherited
hashValue int
no setter
hasParameters bool
Check if this command has parameters
no setter
hasSwitches bool
Check if this command has switches
no setter
isScriptCommand bool
Check if this is a script command (has executable script)
no setter
optionalParams List<Param>
Optional parameters for this command
final
override bool
Whether this command overrides a reserved command
final
requiredParams List<Param>
Required parameters for this command
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
script String?
The script to execute (renamed from commandText for consistency with YAML) Can be null if this command only has switches
final
switches Map<String, Command>
Map of switch name to Command (for hierarchical commands) Example: {"ios": Command(...), "android": Command(...)}
final
switchesInfo List<SwitchInfo>
Computed list of SwitchInfo objects with metadata
no setter

Methods

getSwitchInfo(String arg) SwitchInfo?
Get SwitchInfo by matching name or flag alias
isEqual(Object other) bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
toStringRepresentation() String

Operators

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