-
Notifications
You must be signed in to change notification settings - Fork 157
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 completion for popular shells #629
Comments
Ideally instrument it in a way that parameters in Python and completions can easily be kept in sync to prevent drift. One option is to generate them from the argparse definitions. Another approach can be to generate them from the helpfile or manpage as some external tools do. For Zsh at least it is worth considering a mechanism of installing completions. |
Perhaps argcomplete? |
Having a shell completion improves developers' workflow and makes it easier for everyone to notice as the program gains new options. This commit adds support for generatic static completion files via python-shtab. Unlike other solutions which repeatedly invoke the underlying program, to retrieve the next suggestion, shtab parses argparse options and produces a complete static file. It currently supports bash, tcsh and bash with PR opened for fish support. For example, to generate zsh completion use: - reuse --print-completion zsh > /usr/share/zsh/site-functions/_reuse This can be done by the reuse project itself, the package maintainer or end-user. For more details, see https://github.com/iterative/shtab Closes: fsfe#629 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Having a shell completion improves developers' workflow and makes it easier for everyone to notice as the program gains new options. This commit adds support for generatic static completion files via python-shtab. Unlike other solutions which repeatedly invoke the underlying program, to retrieve the next suggestion, shtab parses argparse options and produces a complete static file. It currently supports bash, tcsh and bash with PR opened for fish support. For example, to generate zsh completion use: - reuse --print-completion zsh > /usr/share/zsh/site-functions/_reuse This can be done by the reuse project itself, the package maintainer or end-user. For more details, see https://github.com/iterative/shtab Closes: fsfe#629 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
#1076 should address this in a somewhat elegant manner IMHO. |
Having a shell completion improves developers' workflow and makes it easier for everyone to notice as the program gains new options. This commit adds support for generatic static completion files via python-shtab. Unlike other solutions which repeatedly invoke the underlying program, to retrieve the next suggestion, shtab parses argparse options and produces a complete static file. It currently supports bash, tcsh and bash with PR opened for fish support. For example, to generate zsh completion use: - reuse --print-completion zsh > /usr/share/zsh/site-functions/_reuse This can be done by the reuse project itself, the package maintainer or end-user. For more details, see https://github.com/iterative/shtab Closes: fsfe#629 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Having a shell completion improves developers' workflow and makes it easier for everyone to notice as the program gains new options. This commit adds support for generatic static completion files via python-shtab. Unlike other solutions which repeatedly invoke the underlying program, to retrieve the next suggestion, shtab parses argparse options and produces a complete static file. It currently supports bash, tcsh and bash with PR opened for fish support. For example, to generate zsh completion use: - reuse --print-completion zsh > /usr/share/zsh/site-functions/_reuse This can be done by the reuse project itself, the package maintainer or end-user. For more details, see https://github.com/iterative/shtab Closes: fsfe#629 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Having a shell completion improves developers' workflow and makes it easier for everyone to notice as the program gains new options. This commit adds support for generatic static completion files via python-shtab. Unlike other solutions which repeatedly invoke the underlying program, to retrieve the next suggestion, shtab parses argparse options and produces a complete static file. It currently supports bash, tcsh and bash with PR opened for fish support. For example, to generate zsh completion use: - reuse --print-completion zsh > /usr/share/zsh/site-functions/_reuse This can be done by the reuse project itself, the package maintainer or end-user. For more details, see https://github.com/iterative/shtab Closes: fsfe#629 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Having a shell completion improves developers' workflow and makes it easier for everyone to notice as the program gains new options. This commit adds support for generatic static completion files via python-shtab. Unlike other solutions which repeatedly invoke the underlying program, to retrieve the next suggestion, shtab parses argparse options and produces a complete static file. It currently supports bash, tcsh and bash with PR opened for fish support. For example, to generate zsh completion use: - reuse --print-completion zsh > /usr/share/zsh/site-functions/_reuse This can be done by the reuse project itself, the package maintainer or end-user. For more details, see https://github.com/iterative/shtab Closes: fsfe#629 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Having a shell completion improves developers' workflow and makes it easier for everyone to notice as the program gains new options. This commit adds support for generatic static completion files via python-shtab. Unlike other solutions which repeatedly invoke the underlying program, to retrieve the next suggestion, shtab parses argparse options and produces a complete static file. It currently supports bash, tcsh and bash with PR opened for fish support. For example, to generate zsh completion use: - reuse --print-completion zsh > /usr/share/zsh/site-functions/_reuse This can be done by the reuse project itself, the package maintainer or end-user. For more details, see https://github.com/iterative/shtab Closes: fsfe#629 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Having a shell completion improves developers' workflow and makes it easier for everyone to notice as the program gains new options. This commit adds support for generatic static completion files via shtab. Unlike other solutions which repeatedly invoke the underlying program, to retrieve the next suggestion, shtab parses argparse options and produces a complete static file. It currently supports bash, tcsh and bash with PR opened for fish support. For example, to generate zsh completion use: - reuse --print-completion zsh > /usr/share/zsh/site-functions/_reuse This can be done by the reuse project itself, the package maintainer or end-user. For more details, see https://github.com/iterative/shtab Closes: fsfe#629 Co-authored-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com
FWIW, I wish Re-use also implemented argcomplete completion and allowed users to chose between speed and more automatic completion. For example, if it did implement |
@rpatterson Can you open a new issue for this? I am not intensely familiar with argcomplete (nor shtab, for that matter). Can they be used in parallel? |
Done, @carmenbianca, but I was really just sharing an opinion and alternate use case for posterity. It's not worth much of your time. |
It would be really nice to have completion for all the popular shells such as:
The text was updated successfully, but these errors were encountered: