Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] support shell completions #62

Open
Freed-Wu opened this issue Aug 5, 2023 · 0 comments
Open

[feature] support shell completions #62

Freed-Wu opened this issue Aug 5, 2023 · 0 comments

Comments

@Freed-Wu
Copy link

Freed-Wu commented Aug 5, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant