CompletionInstallation class

Manages the installation of completion scripts for the current shell.

Creation should be done via CompletionInstallation.fromSystemShell.

Constructors

CompletionInstallation({required ShellCompletionConfiguration? configuration, required Logger logger, required bool isWindows, required Map<String, String> environment})
Manages the installation of completion scripts for the current shell.
CompletionInstallation.fromSystemShell({required SystemShell? systemShell, required Logger logger, bool? isWindowsOverride, Map<String, String>? environmentOverride})
Creates a CompletionInstallation given the current systemShell.
factory

Properties

completionConfigDir Directory
Define the Directory in which the completion configuration files will be stored.
no setter
completionConfigurationFile File
Define the File in which the completion configuration is stored.
no setter
configuration ShellCompletionConfiguration?
The associated ShellCompletionConfiguration inferred from the current shell. It is null if the current shell is unknown.
final
environment Map<String, String>
Describes the environment variables. Usually equals to Platform.environment.
final
hashCode int
The hash code for this object.
no setterinherited
isWindows bool
Defines whether the installation is running on windows or not.
final
logger → Logger
The injected Logger;
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createCompletionConfigDir() → void
Create a directory in which the completion config files shall be saved. If the directory already exists, it will do nothing.
install(String rootCommand, {bool force = false}) → void
Install completion configuration files for a rootCommand in the current shell.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
uninstall(String rootCommand) → void
Uninstalls the completion for the command rootCommand on the current shell.
writeCompletionConfigForShell(String rootCommand) → void
Adds a reference for the command-specific config file created on writeCompletionScriptForCommand the the global completion config file.
writeCompletionScriptForCommand(String rootCommand) bool
Creates a configuration file exclusively to rootCommand and the identified shell.
writeToShellConfigFile(String rootCommand) → void
Write a source to the completion global script in the shell configuration file, which its location is described by the configuration.

Operators

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