CompletionLevel class

The necessary information to produce completion for CommandRunner-based cli applications.

The grammar, visibleSubcommands and visibleOptions should be derived from a CommandRunner and a Command.

See also find to learn how it is created.

Annotations
  • @immutable

Constructors

CompletionLevel({required ArgParser grammar, required List<String> rawArgs, required List<Command> visibleSubcommands, required List<Option> visibleOptions, ArgResults? parsedOptions})
The necessary information to produce completion for CommandRunner-based cli applications.
const

Properties

grammar → ArgParser
The ArgParser declared in the CommandRunner or Command that needs completion.
final
hashCode int
The hash code for this object.
no setterinherited
parsedOptions → ArgResults?
An ArgResults that includes the valid options passed to the command on completion level. Null if no valid options were passed.
final
rawArgs List<String>
The user input that needs completion starting from the command/sub_command being completed.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
visibleOptions List<Option>
The visible options declared by grammar.
final
visibleSubcommands List<Command>
The visible commands declared by grammar in the form of Command instances.
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

Operators

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

Static Methods

find(Iterable<String> rootArgs, ArgParser runnerGrammar, Map<String, Command> runnerCommands) CompletionLevel?
Given a user input rootArgs and the runnerGrammar, it finds the innermost context that needs completion.