relgap completion
Generate the autocompletion script for relgap for the specified shell. See each sub-command's help for details on how to use the generated script.
Usage
relgap completion <shell>Shells
| Shell | Command |
|---|---|
| bash | relgap completion bash |
| clink | relgap completion clink |
| elvish | relgap completion elvish |
| fish | relgap completion fish |
| nushell | relgap completion nushell |
| oil | relgap completion oil |
| powershell | relgap completion powershell |
| tcsh | relgap completion tcsh |
| xonsh | relgap completion xonsh |
| zsh | relgap 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 <(relgap completion bash)To load completions for every new session, execute once:
Linux
relgap completion bash > /etc/bash_completion.d/relgapmacOS
relgap completion bash > $(brew --prefix)/etc/bash_completion.d/relgapYou 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 relgap, writes it.
Save the script as a Lua file in a clink scripts directory, such as %LOCALAPPDATA%\clink\relgap.lua:
relgap completion clink > %LOCALAPPDATA%\clink\relgap.luaelvish
Generate the autocompletion script for elvish. carapace, built into relgap, writes it.
Add this line to ~/.config/elvish/rc.elv:
eval (relgap completion elvish | slurp)fish
Generate the autocompletion script for the fish shell.
To load completions in your current shell session:
relgap completion fish | sourceTo load completions for every new session, execute once:
relgap completion fish > ~/.config/fish/completions/relgap.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 relgap, writes it.
The script defines $relgap_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 relgap):
relgap completion nushell | save --force ~/.config/nushell/relgap.nu
# config.nu
source ~/.config/nushell/relgap.nu
$env.config.completions.external = {enable: true, completer: $relgap_completer}oil
Generate the autocompletion script for oil. carapace, built into relgap, writes it.
Add this line to your oils startup file (~/.config/oils/oshrc or yshrc):
source <(relgap completion oil)powershell
Generate the autocompletion script for powershell.
To load completions in your current shell session:
relgap 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 relgap, writes it.
Add this line to ~/.tcshrc:
eval `relgap completion tcsh`xonsh
Generate the autocompletion script for xonsh. carapace, built into relgap, writes it.
Add this line to ~/.xonshrc:
exec($(relgap 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 <(relgap completion zsh)To load completions for every new session, execute once:
Linux
relgap completion zsh > "${fpath[1]}/_relgap"macOS
relgap completion zsh > $(brew --prefix)/share/zsh/site-functions/_relgapYou 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
relgap completion bash > /etc/bash_completion.d/relgap
relgap completion zsh > "${fpath[1]}/_relgap"
relgap completion fish > ~/.config/fish/completions/relgap.fish