feat(autocomplete): add autocompletion for fish shell

This commit is contained in:
2022-11-15 22:24:34 +01:00
parent 14187449a5
commit 521d3d1259
3 changed files with 19 additions and 1 deletions

View File

@ -29,7 +29,7 @@ var AutoCompleteCommand = cli.Command{
Description: `
Set up auto-completion in your shell by downloading the relevant files and
laying out what additional information must be loaded. Supported shells are as
follows: bash, fizsh & zsh.
follows: bash, fish, fizsh & zsh.
Example:
@ -50,6 +50,7 @@ Example:
"bash": true,
"zsh": true,
"fizsh": true,
"fish": true,
}
if _, ok := supportedShells[shellType]; !ok {
@ -93,6 +94,14 @@ sudo mkdir /etc/zsh/completion.d/
sudo cp %s /etc/zsh/completion.d/abra
echo "PROG=abra\n_CLI_ZSH_AUTOCOMPLETE_HACK=1\nsource /etc/zsh/completion.d/abra" >> ~/.zshrc
# And finally run "abra app ps <hit tab key>" to test things are working, you should see app domains listed!
`, autocompletionFile))
case "fish":
fmt.Println(fmt.Sprintf(`
# Run the following commands to install auto-completion
sudo mkdir -p /etc/fish/completions
sudo cp %s /etc/fish/completions/abra
echo "source /etc/fish/completions/abra" >> ~/.config/fish/config.fish
# And finally run "abra app ps <hit tab key>" to test things are working, you should see app domains listed!
`, autocompletionFile))
}