fsfe / reuse-tool

reuse is a tool for compliance with the REUSE recommendations.
https://reuse.software
401 stars 148 forks source link

Add completion for popular shells #629

Closed linozen closed 1 month ago

linozen commented 1 year ago

It would be really nice to have completion for all the popular shells such as:

nicorikken commented 1 year ago

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.

rpatterson commented 1 year ago

Perhaps argcomplete?

evelikov commented 1 month ago

https://github.com/fsfe/reuse-tool/pull/1076 should address this in a somewhat elegant manner IMHO.

rpatterson commented 1 month ago

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 argcomplete, I would get tab completion on my system without any changes other than the code changes in re-use because I already have /etc/bash_completion.d/python-argcomplete installed. It's pretty trivial.

carmenbianca commented 1 month ago

@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?

rpatterson commented 1 month ago

Can you open a new issue for this?

Done, @carmenbianca, but I was really just sharing an opinion and alternate use case for posterity. It's not worth much of your time.