init: make spack.cmd.all_commands lazy
- `spack.cmd.all_commands` does a directory listing on `lib/spack/spack/cmd`, regardless of whether it is needed - make this lazy so that the directory listing won't happen unless it's necessary.
This commit is contained in:
@@ -77,7 +77,8 @@
|
||||
# Find all the `cmd-spack-*` references and add them to a command index
|
||||
#
|
||||
import spack
|
||||
command_names = spack.cmd.all_commands
|
||||
import spack.cmd
|
||||
command_names = spack.cmd.all_commands()
|
||||
documented_commands = set()
|
||||
for filename in glob('*rst'):
|
||||
with open(filename) as f:
|
||||
|
Reference in New Issue
Block a user