Show extension commands with spack -h (#41726)
* Execute `args.help` after setting main options so that extension commands will show with `spack -h` --------- Co-authored-by: psakievich <psakiev@sandia.gov>
This commit is contained in:
parent
50ee3624c0
commit
3a50d32299
1 changed files with 7 additions and 5 deletions
|
@ -950,14 +950,10 @@ def _main(argv=None):
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# -h, -H, and -V are special as they do not require a command, but
|
# version is special as it does not require a command or loading and additional infrastructure
|
||||||
# all the other options do nothing without a command.
|
|
||||||
if args.version:
|
if args.version:
|
||||||
print(get_version())
|
print(get_version())
|
||||||
return 0
|
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.
|
# 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(","))
|
print_setup_info(*args.print_shell_vars.split(","))
|
||||||
return 0
|
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
|
# At this point we've considered all the options to spack itself, so we
|
||||||
# need a command or we're done.
|
# need a command or we're done.
|
||||||
if not args.command:
|
if not args.command:
|
||||||
|
|
Loading…
Reference in a new issue