about summary refs log tree commit diff
path: root/src/bootstrap/bootstrap.py
diff options
context:
space:
mode:
authorNathan Stocks <nathan.stocks@gmail.com>2017-04-01 15:48:03 -0600
committerNathan Stocks <nathan.stocks@gmail.com>2017-04-02 12:57:08 -0600
commitaa4bd0ec0ea0e4edd2a4507c776f9979a05005d1 (patch)
treedae081f71cc0cef171f9dcf111a784e0a691697b /src/bootstrap/bootstrap.py
parent5ba579e7f43e607315737899a779d8bd0f378f53 (diff)
downloadrust-aa4bd0ec0ea0e4edd2a4507c776f9979a05005d1.tar.gz
rust-aa4bd0ec0ea0e4edd2a4507c776f9979a05005d1.zip
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.
Diffstat (limited to 'src/bootstrap/bootstrap.py')
-rw-r--r--src/bootstrap/bootstrap.py5
1 files changed, 3 insertions, 2 deletions
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)