CompletionSettings class

Settings for the built-in shell completion support of a CommandRunner.

Completion is enabled by default. It adds:

  • a hidden __complete request handler that the shell completion scripts call to obtain the completion alternatives,
  • a completion subcommand that prints the completion script for a shell, and installs it with completion install, when the runner has subcommands,
  • a --completion <shell> global option that does the same, when the runner has no subcommands.

The generated scripts carry their installation instructions in their comment header, so that they are available for both kinds of runners.

Constructors

CompletionSettings({bool enabled = true, bool hideCommand = false, bool exitAfterResponse = false, OutputSinks sinks = const OutputSinks()})
const

Properties

enabled → bool
Whether completion support is enabled.
final
exitAfterResponse → bool
Whether the process exits (with exit code 0) as soon as a completion response or a completion script has been written.
final
hashCode → int
The hash code for this object.
no setterinherited
hideCommand → bool
Whether the completion subcommand is hidden from the usage help.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sinks → OutputSinks
Where completion responses, scripts, and failure diagnostics are written.
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

Constants

disabled → const CompletionSettings
Disables completion support entirely.