On the website the instructions for generating completions for bash and zsh are given as:
usage --completions bash > /etc/bash_completion.d/usage
usage --completions zsh > /usr/share/zsh/site-functions/_usage
The problem is redirection to those directories requires root access so both commands would fail. Here is the improved version using 'tee' with 'sudo':
usage --completions bash | sudo tee /etc/bash_completion.d/usage
usage --completions zsh | sudo tee /usr/share/zsh/site-functions/_usage
If echoing the content of completions to stdout is undesirable, it can be hidden:
usage --completions bash | sudo tee /etc/bash_completion.d/usage >/dev/null
usage --completions zsh | sudo tee /usr/share/zsh/site-functions/_usage >/dev/null
On the website the instructions for generating completions for bash and zsh are given as:
The problem is redirection to those directories requires root access so both commands would fail. Here is the improved version using 'tee' with 'sudo':
If echoing the content of completions to stdout is undesirable, it can be hidden: