From aa4bd0ec0ea0e4edd2a4507c776f9979a05005d1 Mon Sep 17 00:00:00 2001 From: Nathan Stocks Date: Sat, 1 Apr 2017 15:48:03 -0600 Subject: Finish the improvements I planned. - No more manual args manipulation -- getopts used for everything. As a result, options can be in any position, now, even before the subcommand. - The additional options for test, bench, and dist now appear in the help output. - No more single-letter variable bindings used internally for large scopes. - Don't output the time measurement when just invoking 'x.py' - Logic is now much more linear. We build strings up, and then print them. --- src/bootstrap/bootstrap.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/bootstrap/bootstrap.py') diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 73f3b1d1ceb..0e5991a51bc 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -591,9 +591,10 @@ def bootstrap(): def main(): start_time = time() + help_triggered = ('-h' in sys.argv) or ('--help' in sys.argv) or (len(sys.argv) == 1) try: bootstrap() - if ('-h' not in sys.argv) and ('--help' not in sys.argv): + if not help_triggered: print("Build completed successfully in %s" % format_build_time(time() - start_time)) except (SystemExit, KeyboardInterrupt) as e: if hasattr(e, 'code') and isinstance(e.code, int): @@ -601,7 +602,7 @@ def main(): else: exit_code = 1 print(e) - if ('-h' not in sys.argv) and ('--help' not in sys.argv): + if not help_triggered: print("Build completed unsuccessfully in %s" % format_build_time(time() - start_time)) sys.exit(exit_code) -- cgit 1.4.1-3-g733a5