reuse-tool icon indicating copy to clipboard operation
reuse-tool copied to clipboard

Implement argcomplete shell completion

Open rpatterson opened this issue 1 year ago • 3 comments

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 avatar Sep 27 '24 21:09 rpatterson

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.

rpatterson avatar Sep 27 '24 21:09 rpatterson

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.

evelikov avatar Sep 29 '24 11:09 evelikov

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.

rpatterson avatar Sep 29 '24 13:09 rpatterson

Hi! This repository is being migrated away from GitHub towards Codeberg. More context can be found in #865. This issue can henceforth be found at https://codeberg.org/fsfe/reuse-tool/issues/1082. Any comments subsequent to this comment will not be migrated.

carmenbianca avatar Nov 24 '25 14:11 carmenbianca