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

Add shell completions by shtab #2506

Closed
wants to merge 1 commit into from
Closed

Add shell completions by shtab #2506

wants to merge 1 commit into from

Conversation

Freed-Wu
Copy link

@Freed-Wu Freed-Wu commented Sep 7, 2022

Maybe fix #1119. Just offer a few commonplace remarks by way of introduction in the
hope that others may come up with valuable opinions.

complete for installed hooks

Not fixed.

don't really want to add a dependency for this

Introduce an extras_require. Even if shtab is not installed, it still can work.

pre-commit --print-completion bash | sudo tee /usr/share/bash-completion/completions/pre-commit
pre-commit --print-completion zsh | sudo tee /usr/share/zsh/site-functions/_pre-commit
pre-commit --print-completion tcsh | sudo tee /etc/profile.d/pre-commit.completion.csh

pre-commit --print-completion bash | sudo tee /usr/share/bash-completion/completions/pre-commit
pre-commit --print-completion zsh | sudo tee /usr/share/zsh/site-functions/_pre-commit
pre-commit --print-completion tcsh | sudo tee /etc/profile.d/pre-commit.completion.csh
@asottile
Copy link
Member

asottile commented Sep 7, 2022

as stated in #1119 I do not want to add a dependency for this

@asottile asottile closed this Sep 7, 2022
@asottile
Copy link
Member

asottile commented Sep 7, 2022

especially one which adds a bunch of monkeypatch hacks

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

Successfully merging this pull request may close these issues.

Completions for CLI
2 participants