-
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 shell completion support #1076
Conversation
7103b2f
to
c2f11e8
Compare
Note: my poetry knowledge is about zero, so I'm not sure what's the better way to handle the extra optional dependency. The mypy workflow seems to be failing because of it. Any suggestions are deeply appreciated. |
c2f11e8
to
df31c88
Compare
b450c11
to
acfb363
Compare
Hi @evelikov and thanks for your contribution! This looks like an awesome little Python package. I have patched up the PR. I would love a review from you before merging. |
acfb363
to
814627b
Compare
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
814627b
to
7b8514a
Compare
Squashed, rebased, added a whole heap of tags to the commit, and ready to merge :) Thanks @evelikov ! |
Add shell completion support via python-shtab. The reuse project/maitnainer/end-user can generate the static shell completion (currently bash, tcsh and zsh, with fish in progress) file via the
reuse --print-completion SHELL
command.changelog.d/<directory>/
.AUTHORS.rst
.docs/man/
or elsewhere.the current specification.
changed files.