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