Shell completion
torchio completions <bash|zsh|fish> prints a script that makes the shell complete the commands (torchio me<Tab> gives memory), their options (--hold, --url…) and the words on and off of ready. With Homebrew the completions are installed with the binary: open a new shell. Otherwise:
# bash: in ~/.bashrc
eval "$(torchio completions bash)"
# zsh: in ~/.zshrc, after compinit
eval "$(torchio completions zsh)"
# fish
torchio completions fish > ~/.config/fish/completions/torchio.fish
If Tab does nothing in zsh after brew install, there are two usual causes:
- The folder of the completions,
$(brew --prefix)/share/zsh/site-functions, is not in yourfpath.brew shellenvadds it, so run it beforecompinitor before Oh My Zsh (which callscompinit):eval "$(brew shellenv)". See Homebrew’s page on shell completion. compinitignores the folders that the group can write to, and Oh My Zsh calls it with-i, so it does not say so. Ifls -ld $(brew --prefix)/share/zsh/site-functionsshowsdrwxrwxr-x, remove the group’s write permission from that folder and its two parents, and not from the whole prefix:chmod go-w "$(brew --prefix)/share" "$(brew --prefix)/share/zsh" "$(brew --prefix)/share/zsh/site-functions". Then open a new shell, and delete~/.zcompdump*if it still does not complete.
The scripts are generated from the commands of the binary, so they always match the version you have. On the command line of watch, Tab completes the name of a command.