Open benthayer opened 4 years ago
@e-leclercq Are you still interested in this?
Just a comment on possible solutions...
The way that argcomplete
works is that it runs the script up to a certain function call, and then returns the bash completions, more or less. So, it ends up being the case that bash completion feels slow and laggy.
An alternative that we should look into is the use of completions
, which generates bash/zsh/fish completion from a YAML file. It also has a Python API, so we could have a make_completion.py
to generate it like how we have a make_level.py
.
https://github.com/pwwang/completions
completions
seems like it would work, but I want to make sure that we actually have autocompletion for every command that we can run so we don't get confused when adding it later. Do you think we could make a script to generate the yaml from the parser defined in GitGud.__init__
?
A make_completion.py
definitely seems possible, just iterate over command_dict and all_skills and whatnot. Might be a fun little Hacktoberfest project, too.
Let's leave it open to whoever wants to tackle this
Leaving this here in case it's relevant, since we're invoking with git gud
and not git-gud
: https://stackoverflow.com/questions/41307313/custom-git-command-autocompletion
In bash, you can autocomplete commands so that you can hit tab when writing
git gud load int
and it'll fill it in withgit gud load intro
.@e-leclercq is currently working on this.