Skip to content

[feature] support shell completions #62

Open

Description

@Freed-Wu

Can it support generating completions for common shells? For python's argparse, we have shtab, can generate shell completion script from a template.

Solution 1: Let user do it by themselves

# After installing foo
$ foo --print-completion bash | sudo tee /usr/share/bash-completion/completions/foo
# completion can work
$ foo -<TAB>

Solution 2: Write some install() in cmake

$ cmake -Bbuild -DCMAKE_INSTALL_PREFIX=/usr
$ cmake --build build
$ cmake --install build
$ ls /usr/share/bash-completion/completions/foo
/usr/share/bash-completion/completions/foo
# completion can work
$ foo -<TAB>

I thinks solution 2 will be better?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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