tfcensus completion
Generate the autocompletion script for tfcensus for the specified shell. See each sub-command's help for details on how to use the generated script.
Usage
tfcensus completion <shell>Shells
| Shell | Command |
|---|---|
| bash | tfcensus completion bash |
| clink | tfcensus completion clink |
| elvish | tfcensus completion elvish |
| fish | tfcensus completion fish |
| nushell | tfcensus completion nushell |
| oil | tfcensus completion oil |
| powershell | tfcensus completion powershell |
| tcsh | tfcensus completion tcsh |
| xonsh | tfcensus completion xonsh |
| zsh | tfcensus completion zsh |
The global flags work with every command. The shell commands ignore --format.
bash
Generate the autocompletion script for the bash shell.
This script depends on the 'bash-completion' package. If it is not installed already, you can install it via your OS's package manager.
To load completions in your current shell session:
source <(tfcensus completion bash)To load completions for every new session, execute once:
Linux
tfcensus completion bash > /etc/bash_completion.d/tfcensusmacOS
tfcensus completion bash > $(brew --prefix)/etc/bash_completion.d/tfcensusYou will need to start a new shell for this setup to take effect.
| Flag | Description | Type | Default | Values | Config key | Notes |
|---|---|---|---|---|---|---|
--no-descriptions | disable completion descriptions | bool |
clink
Generate the autocompletion script for clink. carapace, built into tfcensus, writes it.
Save the script as a Lua file in a clink scripts directory, such as %LOCALAPPDATA%\clink\tfcensus.lua:
tfcensus completion clink > %LOCALAPPDATA%\clink\tfcensus.luaelvish
Generate the autocompletion script for elvish. carapace, built into tfcensus, writes it.
Add this line to ~/.config/elvish/rc.elv:
eval (tfcensus completion elvish | slurp)fish
Generate the autocompletion script for the fish shell.
To load completions in your current shell session:
tfcensus completion fish | sourceTo load completions for every new session, execute once:
tfcensus completion fish > ~/.config/fish/completions/tfcensus.fishYou will need to start a new shell for this setup to take effect.
| Flag | Description | Type | Default | Values | Config key | Notes |
|---|---|---|---|---|---|---|
--no-descriptions | disable completion descriptions | bool |
nushell
Generate the autocompletion script for nushell. carapace, built into tfcensus, writes it.
The script defines $tfcensus_completer. Save it, source it from config.nu and use it as the external completer (or call it from yours when the first span is tfcensus):
tfcensus completion nushell | save --force ~/.config/nushell/tfcensus.nu
# config.nu
source ~/.config/nushell/tfcensus.nu
$env.config.completions.external = {enable: true, completer: $tfcensus_completer}oil
Generate the autocompletion script for oil. carapace, built into tfcensus, writes it.
Add this line to your oils startup file (~/.config/oils/oshrc or yshrc):
source <(tfcensus completion oil)powershell
Generate the autocompletion script for powershell.
To load completions in your current shell session:
tfcensus completion powershell | Out-String | Invoke-ExpressionTo load completions for every new session, add the output of the above command to your powershell profile.
| Flag | Description | Type | Default | Values | Config key | Notes |
|---|---|---|---|---|---|---|
--no-descriptions | disable completion descriptions | bool |
tcsh
Generate the autocompletion script for tcsh. carapace, built into tfcensus, writes it.
Add this line to ~/.tcshrc:
eval `tfcensus completion tcsh`xonsh
Generate the autocompletion script for xonsh. carapace, built into tfcensus, writes it.
Add this line to ~/.xonshrc:
exec($(tfcensus completion xonsh))zsh
Generate the autocompletion script for the zsh shell.
If shell completion is not already enabled in your environment you will need to enable it. You can execute the following once:
echo "autoload -U compinit; compinit" >> ~/.zshrcTo load completions in your current shell session:
source <(tfcensus completion zsh)To load completions for every new session, execute once:
Linux
tfcensus completion zsh > "${fpath[1]}/_tfcensus"macOS
tfcensus completion zsh > $(brew --prefix)/share/zsh/site-functions/_tfcensusYou will need to start a new shell for this setup to take effect.
| Flag | Description | Type | Default | Values | Config key | Notes |
|---|---|---|---|---|---|---|
--no-descriptions | disable completion descriptions | bool |
Exit codes
| Code | Meaning |
|---|---|
| 0 | The command finished. With --fail-on, nothing matched. |
| 1 | The command failed: a read, a write, a child process or a check failed. |
| 2 | Wrong usage: an unknown command or flag, a bad value or argument, an invalid config file, or a prompt with no terminal. |
| 130 | Interrupted by Ctrl-C (SIGINT) or a cancelled context. |
All codes are listed on the exit codes page.
Examples
tfcensus completion bash > /etc/bash_completion.d/tfcensus
tfcensus completion zsh > "${fpath[1]}/_tfcensus"
tfcensus completion fish > ~/.config/fish/completions/tfcensus.fish