cros: add method to post-process & validate options
Bring a bit of structure to a common pattern by adding an explicit
method to validate & post-process the parsed options. This will
let us enforce freezing of options instead of relying commands to
remember to call the function.
BUG=b:187789324
TEST=CQ passes
Change-Id: I34e6d59a46052398ad49b10358426fe84e783a0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/3341671
Tested-by: Mike Frysinger <vapier@chromium.org>
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Alex Klein <saklein@chromium.org>
Commit-Queue: Alex Klein <saklein@chromium.org>
diff --git a/scripts/cros.py b/scripts/cros.py
index 34f2d68..54025be 100644
--- a/scripts/cros.py
+++ b/scripts/cros.py
@@ -85,6 +85,7 @@
# import the single subcommand.
parser = GetOptions(namespace.subcommand)
namespace = parser.parse_args(argv)
+ namespace.command_class.ProcessOptions(parser, namespace)
subcommand = namespace.command_class(namespace)
try:
code = _RunSubCommand(subcommand)