DevToolExecutionContext class

A representation of the command-line execution context in which a DevTool is being run.

An instance of this class should be created by DevToolCommand when calling DevTool.run so that the tool can utilize the parsed arg results, whether or not global verbose mode is enabled, and the usageException utility function from Command.

Constructors

DevToolExecutionContext({ArgResults? argResults, String? commandName, void usageException(String message)?, bool verbose = false})

Properties

argResults → ArgResults?
The results from parsing the arguments passed to a Command if this tool was executed via a command-line app.
final
commandName String?
The name of the Command that executed this tool if it was executed via a command-line app.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
verbose bool
Whether the -v|--verbose flag was enabled when running the Command that executed this tool if it was executed via a command-line app.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
update({ArgResults? argResults, String? commandName, void usageException(String message)?, bool? verbose}) DevToolExecutionContext
Return a copy of this instance with optional updates; any field that does not have an updated value will remain the same.
usageException(String message) → void
Calling this will throw a UsageException with message that should be caught by CommandRunner and used to set the exit code accordingly and print out usage information.

Operators

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