1
Fork 0

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.
This commit is contained in:
Nathan Stocks 2017-04-01 15:48:03 -06:00
parent 5ba579e7f4
commit aa4bd0ec0e
3 changed files with 113 additions and 125 deletions

View file

@ -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)