bisect-kit: revise argument parsing
Currently, the command line argument parser only accepts syntax like
(note the order of --session)
A) ./bisect_list.py --session id init --old foo --new bar
but not
B) ./bisect_list.py init --session id --old foo --new bar
This CL reversed the behavior: reject the former and accept the latter.
Be careful this change is not backward compatible.
BUG=None
TEST=run all scripts and their subcommands with --help
Change-Id: Ifbe6035f2d83d0f0b03e747db9f17880e45bde77
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/bisect-kit/+/2653434
Reviewed-by: Zheng-Jie Chang <zjchang@chromium.org>
Commit-Queue: Kuang-che Wu <kcwu@chromium.org>
Tested-by: Kuang-che Wu <kcwu@chromium.org>
diff --git a/eval_cros_autotest.py b/eval_cros_autotest.py
index ed44e3c..bbe8403 100755
--- a/eval_cros_autotest.py
+++ b/eval_cros_autotest.py
@@ -43,9 +43,9 @@
def create_argument_parser():
- parser = argparse.ArgumentParser(description=__doc__)
+ parents = [common.common_argument_parser, common.session_optional_parser]
+ parser = argparse.ArgumentParser(description=__doc__, parents=parents)
cli.patching_argparser_exit(parser)
- common.add_common_arguments(parser)
parser.add_argument(
'dut',
nargs='?',