Fix regressions in rbt status-update and convert it to a multi-command.

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

Information

RBTools
release-3.x

Reviewers

rbt status-update didn't survive some of the changes to commands in
RBTools 3. Attempting to set or get a status update would fail at a few
different points. Mainly these had to do with trying to pass in things the
api_root to functions that no longer took them.

Even with those fixed, this command's invocation was a bit strange. It
worked like a multi-command, but had the action last. This meant that
the entire list of options had to be shared across all subcommands.

This change fixes the broken code paths and, in the meantime, redoes
this as a multi-command.

Each subcommand has its own options that pertain to it, and this allows
us to move some validation into the options themselves. For instance,
the status update ID is now required for delete, but is optional for
the other subcommands.

To support backwards-compatibility, we check at option parsing time if
the last parameter is the action name (indicating an old invocation,
where this had to appear last). If found, we warn and then fix up the
order of arguments.

Tested each subcommand on my dev server, along with each available option.
This includes --review with a JSON document. Every subcommand and option
gave me the results I expected.

Tested the validation of the options that support it.

Tested help output for the main command and all subcommands.

Commits

Files