summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/main.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/spack/spack/main.py b/lib/spack/spack/main.py
index 9676d436dd..bff07ccbfb 100644
--- a/lib/spack/spack/main.py
+++ b/lib/spack/spack/main.py
@@ -950,14 +950,10 @@ def _main(argv=None):
parser.print_help()
return 1
- # -h, -H, and -V are special as they do not require a command, but
- # all the other options do nothing without a command.
+ # version is special as it does not require a command or loading and additional infrastructure
if args.version:
print(get_version())
return 0
- elif args.help:
- sys.stdout.write(parser.format_help(level=args.help))
- return 0
# ------------------------------------------------------------------------
# This part of the `main()` sets up Spack's configuration.
@@ -996,6 +992,12 @@ def _main(argv=None):
print_setup_info(*args.print_shell_vars.split(","))
return 0
+ # -h and -H are special as they do not require a command, but
+ # all the other options do nothing without a command.
+ if args.help:
+ sys.stdout.write(parser.format_help(level=args.help))
+ return 0
+
# At this point we've considered all the options to spack itself, so we
# need a command or we're done.
if not args.command: