summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/cmd/config.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/spack/spack/cmd/config.py b/lib/spack/spack/cmd/config.py
index 2fc57a52c5..2dc25353ed 100644
--- a/lib/spack/spack/cmd/config.py
+++ b/lib/spack/spack/cmd/config.py
@@ -143,7 +143,10 @@ def config_get(args):
"""
scope, section = _get_scope_and_section(args)
- if scope and scope.startswith('env:'):
+ if section is not None:
+ spack.config.config.print_section(section)
+
+ elif scope and scope.startswith('env:'):
config_file = spack.config.config.get_config_filename(scope, section)
if os.path.exists(config_file):
with open(config_file) as f:
@@ -151,9 +154,6 @@ def config_get(args):
else:
tty.die('environment has no %s file' % ev.manifest_name)
- elif section is not None:
- spack.config.config.print_section(section)
-
else:
tty.die('`spack config get` requires a section argument '
'or an active environment.')