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

Generating lazy completion scripts for Bash/Zsh #473

Closed
segevfiner opened this issue Feb 26, 2024 · 1 comment · Fixed by #475
Closed

Generating lazy completion scripts for Bash/Zsh #473

segevfiner opened this issue Feb 26, 2024 · 1 comment · Fixed by #475

Comments

@segevfiner
Copy link
Contributor

It would be nice to be able to generate lazy loaded completion scripts for Bash and Zsh instead of having to eagerly register and execute them at shell startup by register-python-argcomplete. For Bash, it is likely the existing script can be used as is, for Zsh, you need #compdef <command> as the first line and to not call compdef but rather call the completion function directly, there is probably a trick or two to make the script work as both. I think click-completion uses one https://github.com/click-contrib/click-completion/blob/master/click_completion/zsh.j2, and also cobra https://github.com/spf13/cobra/blob/main/zsh_completions.go, but there are also others, not sure which is the best.

@kislyuk
Copy link
Owner

kislyuk commented Feb 26, 2024

Yes, that would be nice. PRs are welcome.

segevfiner added a commit to segevfiner/argcomplete that referenced this issue Feb 26, 2024
kislyuk pushed a commit that referenced this issue Mar 4, 2024
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

Successfully merging a pull request may close this issue.

2 participants