Allow multi-commands to have their own options.

Review Request #12184 — Created March 21, 2022 and submitted — Latest diff uploaded

Information

RBTools
release-3.x

Reviewers

This renames the existing option_list usage on BaseMultiCommand to
common_subcommand_option_list, and re-enables option_list as the
options for the main commands on the multi-command.

Through this, it's possible to have commands that take their own options
separate from those on subcommands.

We also inject global options, ensuring that rbt <maincommand> --help
will show --help, --debug, and --json as options.

Verified that rbt review still functioned correctly. rbt review --help
now shows standard options, and subcommands are all sharing the common ones.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Allow multi-commands to have their own options.
This renames the existing `option_list` usage on `BaseMultiCommand` to `common_subcommand_option_list`, and re-enables `option_list` as the options for the main commands on the multi-command. Through this, it's possible to have commands that take their own options separate from those on subcommands. We also inject global options, ensuring that `rbt <maincommand> --help` will show `--help`, `--debug`, and `--json` as options.
4fa07581bfe0d94c98de14eac30d373da75cab43 Christian Hammond
rbtools/commands/__init__.py
rbtools/commands/review.py
Loading...