diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2014-09-16 23:53:44 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2014-09-16 23:53:44 -0700 |
commit | 881fdb66ae9a06671cc756baae5a454fce2c2e3d (patch) | |
tree | ac5a9928f306ae26a32582b60cffc5853e15c514 /bin | |
parent | 782e45e5b1247f636f519c23de4cc54fe0cc21d1 (diff) | |
parent | e2509717b9fc022ddbdfab532fcfc0189102c741 (diff) | |
download | spack-881fdb66ae9a06671cc756baae5a454fce2c2e3d.tar.gz spack-881fdb66ae9a06671cc756baae5a454fce2c2e3d.tar.bz2 spack-881fdb66ae9a06671cc756baae5a454fce2c2e3d.tar.xz spack-881fdb66ae9a06671cc756baae5a454fce2c2e3d.zip |
Merge branch 'develop' into features/fileutils
Conflicts:
lib/spack/spack/packages.py
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/spack | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -24,11 +24,10 @@ # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## import sys -if not sys.version_info[:2] >= (2,7): - sys.exit("Spack requires Python 2.7. Version was %s." % sys.version_info) +if not sys.version_info[:2] >= (2,6): + sys.exit("Spack requires Python 2.6. Version was %s." % sys.version_info) import os -import argparse # Find spack's location and its prefix. SPACK_FILE = os.path.realpath(os.path.expanduser(__file__)) @@ -51,6 +50,7 @@ del SPACK_FILE, SPACK_PREFIX, SPACK_LIB_PATH import llnl.util.tty as tty import spack from spack.error import SpackError +from external import argparse # Command parsing parser = argparse.ArgumentParser( @@ -75,6 +75,13 @@ for cmd in spack.cmd.commands: module = spack.cmd.get_module(cmd) subparser = subparsers.add_parser(cmd, help=module.description) module.setup_parser(subparser) + +# Just print help and exit if run with no arguments at all +if len(sys.argv) == 1: + parser.print_help() + sys.exit(1) + +# actually parse the args. args = parser.parse_args() # Set up environment based on args. |