Open hdwalters opened 3 weeks ago
what kind of completition scripts are you talking about? im pretty sure that @KrosFire is working on an LSP server, so they might not be necessary
No, I'm talking about tab completion on the command line, not keyword completion in an IDE. Suppose I want to type git commit
. If I type this:
$ git co<Tab><Tab>
I get this, where |
represents the cursor:
$ git co
co commit config
$ git co|
If I then type this:
$ git com<Tab>
I get this:
$ git commit |
Whenever the user presses the Tab
key, Bash parses the command line so far, and calls the relevant completion script. It then offers completion options according to the output of that script. The clap
library has a feature where you can generate completion scripts automatically.
I've assigned this and #411 to myself; might as well do both at the same time.
Is your feature request related to a problem? Please describe. A lot of Bash CLI tools provide a command line option to output a completion script. For example,
ripgrep
provides an option:This can be called in a
.bashrc
file, to enable command line completion:It would be nice if Amber supported this.
Describe the solution you'd like Since we already use the
clap
library, we can use the complementaryclap_complete
library to do this.Describe alternatives you've considered N/A
Additional context See https://docs.rs/clap_complete/latest/clap_complete/ for more details.