git, if you type e.g.
git switch and hit
Tab, you will get a list of all your branches. I don’t know how this kind of completion works, but it would be very nice to have.
This would have been a very nice addition. Although this cannot be currently implemented due to
Clap not having an implementation of generating completions from structs. Though this is possible with the builder pattern
To be honest I don’t understand how clap would help here. At the time I want to see the completion, I’m still entering a line in the CLI, so the program hasn’t started yet.
A clap app has the function
generate_completions to output auto completions for a specific shell into a file. This file is loaded by the shell to provide the completions. The problem with our implementation using structs is that it does not have such a method
No, I get that, but I don’t see how
clap can generate completions for runtime information like what channels the current repo has.
Clap maintainer here, what’s the issue with generating completions from structs?
Opts::into_app() should give you the built