Open con-f-use opened 9 years ago
This works correctly in zsh, but not yet in bash. The completion system in bash is not as good as zsh's, so I put less effort trying to make it work perfectly there. I'll leave this open but I don't know if I'll get around to fixing this in bash (help is welcome :))
Okay, thank you. In the unlikely event I have time to spare, I'll have a look. I hope you get around to it. In the meantime you should add a note about known issues in bash. After all bash is by far the more common shell and should be priority.
Btw. there is a very similar tool called docopt-wordlist
out for Rust:
https://github.com/docopt/docopt.rs#tab-completion-support
Its main advantage is, that it generates the completions on the fly, so it reacts to changes in the program withou rerunning the tool. That also allows for generation options dynamically (e.g. based on a configuration file or plugin files to the original program using docopt). Its downside is, that you have to install Rust and cargo on the target system, compile the tool while with docopt_completion
one only has to provide the generated completion script with one's program. Ideally docopt_completion
makes both approaches possible.
The module does not seem to fully honor mandatory backets
(-option)
and ignores commands therein.Example code:
Expected behavior in bash session:
Actual (wrong) behavior in bash session:
Arranging the usage string the other way around as in
exhon.py (cmd -c)
yields better but similarly wrong results: