completion

Generate shell completion scripts for [bash|zsh|fish]

Synopsis

Outputs code for bash, zsh or fish to take advantage of interactive completion. Please refer to the appropriate section of this guide based on your operating system / shell.

Bash:

MacOS

If you are using bash on macOS you will first need to install bash-completion. Our guide uses Homebrew.

Run bash --version and check if you are using either bash 3.2 or 4.1+. Refer to the appropriate section below based on your bash version.

Bash 3.2

Install bash-completion v1.x

brew install bash-completion

Enable bash-completion

echo 'source $(brew --prefix)/etc/bash_completion' >> ~/.bash_profile

Install torero's completion script. While using Bash 3.2, you will have to run this command every time you update torero or switch your application mode to always have the latest completions available.

torero completion bash > $(brew --prefix)/etc/bash_completion.d/torero

And reload your shell

Bash 4.1+ Install bash-completion v2.x

brew install bash-completion@2

Enable bash-completion

echo 'brew_etc="$(brew --prefix)/etc" \
&& [[ -r "${brew_etc}/profile.d/bash_completion.sh" ]] \
&& . "${brew_etc}/profile.d/bash_completion.sh"' >> ~/.bash_profile

Install torero's completion script

echo 'source <(torero completion bash)' >> ~/.bash_profile

And reload your shell

Linux If you are using Bash on Linux, install bash-completion using your package manager

  • yum install bash-completion
  • apt-get install bash-completion
  • etc...

Reload your shell and type type _init_completion

If the command fails, you will also need to run

echo 'source /usr/share/bash-completion/bash_completion' >> ~/.bashrc

Then, run

echo 'source <(torero completion bash)' >> ~/.bashrc

And reload your shell

Zsh: To install torero's completion script on zsh, run

echo 'source <(torero completion zsh)' >> ~/.zshrc

And reload your shell

Fish: To install torero's completion script on Fish, run

echo 'torero completion fish | source' >> ~/.config/fish/config.fish

And reload your shell

torero completion [bash|zsh|fish]

Options

  -h, --help   help for completion

Options inherited from parent commands

      --config string   Path to the configuration file
      --raw             Displays the result of the command in its raw format
      --verbose         Enable verbose output

SEE ALSO