bundlewrap icon indicating copy to clipboard operation
bundlewrap copied to clipboard

Shell completion

Open ThreeFx opened this issue 4 years ago • 4 comments

Having longer node names would makes shell completion functions really useful.

Is that something on the roadmap? I've never done anything in that area but I'd be interested in checking it out (zsh user here).

ThreeFx avatar Feb 13 '21 14:02 ThreeFx

One of our guys at work wrote a Bash completion package years ago. It was way too slow. 😒 Of course, we have close to 1000 nodes in our repo – it might work fine with small repos. But that’s the reason why we eventually dropped it.

Maybe we should dig up the code and see how it performs today. It was a totally different version of bw back then anyway.

(For some reason, I don’t really miss tab completion with bw. Probably because I always have an easy way to copy-paste node names (from Vim or from the prompt of a remote shell). 🤔)

vain avatar Feb 13 '21 15:02 vain

Indeed, I'm currently hacking around a bit and the execution time of bw nodes is remarkably high... Maybe there is a way to cache this somehow?

I think I'd still prefer some completion rather than none. Anyway I'll try it out and report back!

ThreeFx avatar Feb 13 '21 15:02 ThreeFx

Feel free, to try it out: https://github.com/tpenndorf/bundlewrap-bash-completion

tpenndorf avatar Jun 17 '21 16:06 tpenndorf

Maybe this patch suits your needs? I just implemented some Bash completion with argcomplete and got this running on my maschine. I decided to pre-generate a target file list to a file to speed up the commands. This may be automated via git hooks.

0001-Add-bash-completion-including-BWTargetCompleter-clas.patch

j-p-a-u-l avatar Jun 18 '23 22:06 j-p-a-u-l