diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2015-01-13 01:00:55 -0800 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2015-01-13 01:00:55 -0800 |
commit | f73abe6849bc4534ce139166f11d8f98a59dc7b5 (patch) | |
tree | f0dc2f7949af5975b36dfc316b708bb9636e23fa /bin | |
parent | fa67d695851878f0601afdfe1660b84829678b50 (diff) | |
parent | 9db967be9827d44150a840f52ecd1e0f28b5bd4e (diff) | |
download | spack-f73abe6849bc4534ce139166f11d8f98a59dc7b5.tar.gz spack-f73abe6849bc4534ce139166f11d8f98a59dc7b5.tar.bz2 spack-f73abe6849bc4534ce139166f11d8f98a59dc7b5.tar.xz spack-f73abe6849bc4534ce139166f11d8f98a59dc7b5.zip |
Merge branch 'features/dep-graph' into develop
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/spack | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -103,7 +103,7 @@ if args.insecure: # Try to load the particular command asked for and run it command = spack.cmd.get_command(args.command) try: - command(parser, args) + return_val = command(parser, args) except SpackError, e: if spack.debug: # In debug mode, raise with a full stack trace. @@ -116,3 +116,11 @@ except SpackError, e: except KeyboardInterrupt: sys.stderr.write('\n') tty.die("Keyboard interrupt.") + +# Allow commands to return values if they want to exit with some ohter code. +if return_val is None: + sys.exit(0) +elif isinstance(return_val, int): + sys.exit(return_val) +else: + tty.die("Bad return value from command %s: %s" % (args.command, return_val)) |