zsh-completion-generator
zsh-completion-generator copied to clipboard
how to deal with subcommands?
as title says
Example from a program based on click (Python):
Usage: covimerage [OPTIONS] COMMAND [ARGS]...
Options:
-V, --version Show the version and exit.
-v, --verbose Increase verbosity.
-q, --quiet Decrease verbosity.
-l, --loglevel [error|warning|info|debug]
Set logging level explicitly (overrides
-v/-q). [default: info]
--rcfile PATH Configuration file. [default: .coveragerc]
-h, --help Show this message and exit.
Commands:
report A wrapper around `coverage report`.
run Run VIM wrapped with :profile instructions.
write_coverage Parse PROFILE_FILE (output from Vim's...
xml A wrapper around `coverage xml`.
I think a good approach would be to detect subcommands via the introducing Commands: and then call --help on the recursively.
In the completion it would generate a state (->sub_report or similar) for all of them.