hyperqueue
hyperqueue copied to clipboard
hq submit bash completion should include only executable files
The shell completion script (cf #290) for hq submit does not take into account that only executable files are acceptable as commands and also lists non-executable files. So, if I type hq submit ./
, it gives me as completions all files in the directory, whereas it should only give executable files and directories.
For example,
$ mkdir a
$ touch b
$ touch c
$ chmod +x c
$ hq submit ./ <TAB>
a/ b c
$ nohup ./ <TAB >
a/ c
Hi, which shell do you use? It seems that the library that we use for CLI parsing (https://github.com/clap-rs/clap) currently doesn't support such completion for bash
.
I use bash. Thanks for looking at this.
I checked the implementation in the library and indeed for bash this is not implemented yet (it should work for zsh
). There is some interest in making this work (https://github.com/clap-rs/clap/issues/1232), so hopefully it will be implemented in the future, but probably not very soon.
We could in theory reimplement bash completion from scratch and add support for this, but, to be honest, it's a lot of work and something like that is very low on our priority list for now.