summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2013-02-22 00:20:24 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2013-02-22 00:20:24 -0800
commit27b92047854d47465b7efeef8f1bc6f8922ba91c (patch)
tree758ccb8ebe07c0fa39a45655dd8c99cf77184452 /bin
parent707db8dafe7080888577e78f1d4df02b8779a491 (diff)
downloadspack-27b92047854d47465b7efeef8f1bc6f8922ba91c.tar.gz
spack-27b92047854d47465b7efeef8f1bc6f8922ba91c.tar.bz2
spack-27b92047854d47465b7efeef8f1bc6f8922ba91c.tar.xz
spack-27b92047854d47465b7efeef8f1bc6f8922ba91c.zip
Better spack -h: added cmd descriptions.
- each cmd has a desscription attribute that is used for the help strign in argparse.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/spack11
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/spack b/bin/spack
index 03cc802b8c..13312a69d6 100755
--- a/bin/spack
+++ b/bin/spack
@@ -19,9 +19,12 @@ import spack
# Command parsing
parser = argparse.ArgumentParser(
description='Spack: the Supercomputing PACKage Manager.')
-parser.add_argument('-V', '--version', action='version', version="%s" % spack.spack_version)
-parser.add_argument('-v', '--verbose', action='store_true', dest='verbose')
-parser.add_argument('-d', '--debug', action='store_true', dest='debug')
+parser.add_argument('-V', '--version', action='version',
+ version="%s" % spack.spack_version)
+parser.add_argument('-v', '--verbose', action='store_true', dest='verbose',
+ help="print additional output during builds")
+parser.add_argument('-d', '--debug', action='store_true', dest='debug',
+ help="write out debug logs during compile")
# each command module implements a parser() function, to which we pass its
# subparser for setup.
@@ -29,8 +32,8 @@ subparsers = parser.add_subparsers(title="subcommands", dest="command")
import spack.cmd
for cmd in spack.cmd.commands:
- subparser = subparsers.add_parser(cmd)
module = spack.cmd.get_module(cmd)
+ subparser = subparsers.add_parser(cmd, help=module.description)
module.setup_parser(subparser)
args = parser.parse_args()