Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to deal with subcommands? #12

Open
ghost opened this issue Jan 24, 2018 · 1 comment
Open

how to deal with subcommands? #12

ghost opened this issue Jan 24, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 24, 2018

as title says

@blueyed
Copy link
Contributor

blueyed commented May 10, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant