Skip to content

(Website) Cannot generate completions for bash and zsh without sudo #673

Description

@aleksa-radojicic

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions