forked from toolshed/abra
feat(autocomplete): add autocompletion for fish shell
This commit is contained in:
11
cli/cli.go
11
cli/cli.go
@ -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))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user