CommandCompletionContext<T> class

A CompletionContext that carries the command contexts resolved for the words typed so far.

Produced by the command runner when completing an option value. leafContext is the last command, after that command's middleware onRun. CommandContext.runMode is CommandRunMode.completion. Ancestors are CommandContext.prev. CommandContext.provider is shared by the chain; middleware publishes services there for ConfigOptionBase.complete to fetch.

Inheritance

Constructors

CommandCompletionContext({required CommandContext<OptionDefinition, T> leafContext, required String wordToComplete, required List<String> precedingWords, required List<CommandDefinition<OptionDefinition>> commands, required ParsedArgs parsedArgs, required Map<String, String> environment})

Properties

command → CommandDefinition<OptionDefinition>
The command the completed option belongs to on this command line, i.e. the last command.
no setterinherited
commands → List<CommandDefinition<OptionDefinition>>
The commands on the command line so far, root command first.
finalinherited
environment → Map<String, String>
The environment variables of the completion request, i.e. of the shell asking for completion. Not used by the built-in completions; available for custom complete implementations, e.g. to find a server URL.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
leafContext → CommandContext<OptionDefinition, T>
The leaf command context after its middleware onRun.
final
parsedArgs → ParsedArgs
The raw command line arguments parsed so far, for all commands on the command line. Option values are the strings as typed, unvalidated.
finalinherited
precedingWords → List<String>
The complete words preceding the word being completed, not including the executable name.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
wordToComplete → String
The partial text of the value being completed. May be empty.
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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