summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/spack7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/spack b/bin/spack
index 679ca9f1be..2f74761a78 100755
--- a/bin/spack
+++ b/bin/spack
@@ -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.