summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2016-08-30 12:05:14 -0500
committerAdam J. Stewart <ajstewart426@gmail.com>2016-08-30 15:37:23 -0500
commitcc7df29e810b0733d7457720a18fe4400ef90990 (patch)
tree95321a961e78fc5b3719b2b40da87128655a42a1 /bin
parentae2a803496772db9ce6f9245d165b44f587e4389 (diff)
downloadspack-cc7df29e810b0733d7457720a18fe4400ef90990.tar.gz
spack-cc7df29e810b0733d7457720a18fe4400ef90990.tar.bz2
spack-cc7df29e810b0733d7457720a18fe4400ef90990.tar.xz
spack-cc7df29e810b0733d7457720a18fe4400ef90990.zip
Keep dashes in command names, translate to underscores
Diffstat (limited to 'bin')
-rwxr-xr-xbin/spack5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/spack b/bin/spack
index 323a06aa53..17586cc1f6 100755
--- a/bin/spack
+++ b/bin/spack
@@ -127,7 +127,8 @@ subparsers = parser.add_subparsers(metavar='SUBCOMMAND', dest="command")
import spack.cmd
for cmd in spack.cmd.commands:
module = spack.cmd.get_module(cmd)
- subparser = subparsers.add_parser(cmd, help=module.description)
+ cmd_name = cmd.replace('_', '-')
+ subparser = subparsers.add_parser(cmd_name, help=module.description)
module.setup_parser(subparser)
# Just print help and exit if run with no arguments at all
@@ -163,7 +164,7 @@ def main():
spack.curl.add_default_arg('-k')
# Try to load the particular command asked for and run it
- command = spack.cmd.get_command(args.command)
+ command = spack.cmd.get_command(args.command.replace('-', '_'))
try:
return_val = command(parser, args)
except SpackError as e: