fsfe / reuse-tool

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

Implement argcomplete shell completion #1082

Open rpatterson opened 1 month ago

rpatterson commented 1 month ago

While the previously implemented shtab completion is faster and more secure, it also requires installing a /etc/bash_completion.d/* for each tool or application. Alternatively, the completion provided by argcomplete requires installing only one /etc/bash_completion.d/* file, many distributions and OSes have packages that do the equivalent, and argcomplete itself provides a convenience script to install the file. From then on any python tool or application that implements argcomplete gets completion.

Confirm that shtab and argcomplete can co-exist and implement argcomplete also.

rpatterson commented 1 month ago

I would not consider this high priority. I only opened this issue because I ran my mouth in a comment on the shtab issue and a maintainer asked me to open one. These days, most of my use of reuse is integrated into build systems and CI and I can't even recall the last time I used it from an interactive shell. So, yeah, feel free to close this as not planned. I'm almost certainly not going to be submitting a PR for this. :-/

Can they be used in parallel?

I haven't implemented shtab so I can't say for sure, but from what I understand about how they work, there's no reason they should conflict.

evelikov commented 1 month ago

Small correction - distributions usually don't install to /etc/bash_completion.d but to pkg-config --variable=completionsdir bash-completion aka /usr/share/bash-completion/completions.

That said, if you have a PR I would be quite happy to test the argcomplete approach.

rpatterson commented 1 month ago

distributions usually don't install to /etc/bash_completion.d

Simplified for brevity. Without a package, the admin is dealing with that directory. With a package they don't need to care about how it's done. But sure, I'll update the wording.