summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthew Scott Krafczyk <krafczyk.matthew@gmail.com>2017-08-28 12:35:46 -0500
committerscheibelp <scheibel1@llnl.gov>2017-08-28 10:35:46 -0700
commitc94933343a9459503dc95628a4c0bd09fdcb60ac (patch)
tree2a7a801b19108780762c23e77a40337d786de83d /lib
parent005b22aa8b8a68a5d0afe3fc3d06f8e1d85b35da (diff)
downloadspack-c94933343a9459503dc95628a4c0bd09fdcb60ac.tar.gz
spack-c94933343a9459503dc95628a4c0bd09fdcb60ac.tar.bz2
spack-c94933343a9459503dc95628a4c0bd09fdcb60ac.tar.xz
spack-c94933343a9459503dc95628a4c0bd09fdcb60ac.zip
Add --show-full-compiler option to 'spack find'
When 'spack find' is invoked with the '--show-full-compiler' option, the compiler flags and version are shown for each spec that is found.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/__init__.py10
-rw-r--r--lib/spack/spack/cmd/find.py4
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/spack/spack/cmd/__init__.py b/lib/spack/spack/cmd/__init__.py
index 5e4564b1e8..f432fbf585 100644
--- a/lib/spack/spack/cmd/__init__.py
+++ b/lib/spack/spack/cmd/__init__.py
@@ -211,6 +211,7 @@ def display_specs(specs, args=None, **kwargs):
hashes = get_arg('long', False)
namespace = get_arg('namespace', False)
flags = get_arg('show_flags', False)
+ full_compiler = get_arg('show_full_compiler', False)
variants = get_arg('variants', False)
hlen = 7
@@ -219,7 +220,12 @@ def display_specs(specs, args=None, **kwargs):
hlen = None
nfmt = '.' if namespace else '_'
- ffmt = '$%+' if flags else ''
+ ffmt = ''
+ if full_compiler or flags:
+ ffmt += '$%'
+ if full_compiler:
+ ffmt += '@'
+ ffmt += '+'
vfmt = '$+' if variants else ''
format_string = '$%s$@%s%s' % (nfmt, ffmt, vfmt)
@@ -259,7 +265,7 @@ def display_specs(specs, args=None, **kwargs):
elif mode == 'short':
# Print columns of output if not printing flags
- if not flags:
+ if not flags and not full_compiler:
def fmt(s):
string = ""
diff --git a/lib/spack/spack/cmd/find.py b/lib/spack/spack/cmd/find.py
index bb8e2e5bcf..02ff10f425 100644
--- a/lib/spack/spack/cmd/find.py
+++ b/lib/spack/spack/cmd/find.py
@@ -60,6 +60,10 @@ def setup_parser(subparser):
action='store_true',
dest='show_flags',
help='show spec compiler flags')
+ subparser.add_argument('--show-full-compiler',
+ action='store_true',
+ dest='show_full_compiler',
+ help='show full compiler specs')
implicit_explicit = subparser.add_mutually_exclusive_group()
implicit_explicit.add_argument(
'-e', '--explicit',