aboutsummaryrefslogtreecommitdiff
path: root/tools/buildman/main.py
diff options
context:
space:
mode:
authorSimon Glass2023-07-19 17:49:04 -0600
committerSimon Glass2023-07-24 09:34:11 -0600
commit529957c3157c7667d9ccfbf539ccad7316a37f83 (patch)
tree3dc5e91e75d86c66fb97811f5daf626c54b5b0c8 /tools/buildman/main.py
parent6a0c7b4a5eabf021d646d4435b00947529ebd13b (diff)
buildman: Convert to argparse
Use argparse to parse the arguments, since OptionParser is deprecated now. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/buildman/main.py')
-rwxr-xr-xtools/buildman/main.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/tools/buildman/main.py b/tools/buildman/main.py
index 70ab9a482ee..097e0594bf0 100755
--- a/tools/buildman/main.py
+++ b/tools/buildman/main.py
@@ -41,7 +41,7 @@ def run_tests(skip_net_tests, debug, verbose, args):
from buildman import func_test
from buildman import test
- test_name = args and args[0] or None
+ test_name = args.terms and args.terms[0] or None
if skip_net_tests:
test.use_network = False
@@ -60,23 +60,22 @@ def run_buildman():
This is the main program. It collects arguments and runs either the tests or
the control module.
"""
- options, args = cmdline.parse_args()
+ args = cmdline.parse_args()
- if not options.debug:
+ if not args.debug:
sys.tracebacklimit = 0
# Run our meagre tests
- if cmdline.HAS_TESTS and options.test:
- return run_tests(options.skip_net_tests, options.debug, options.verbose,
- args)
+ if cmdline.HAS_TESTS and args.test:
+ return run_tests(args.skip_net_tests, args.debug, args.verbose, args)
- elif options.full_help:
+ elif args.full_help:
tools.print_full_help(str(files('buildman').joinpath('README.rst')))
# Build selected commits for selected boards
else:
- bsettings.Setup(options.config_file)
- ret_code = control.do_buildman(options, args)
+ bsettings.Setup(args.config_file)
+ ret_code = control.do_buildman(args)
return ret_code