summaryrefslogtreecommitdiff
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
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.
-rw-r--r--lib/spack/spack/cmd/__init__.py10
-rw-r--r--lib/spack/spack/cmd/find.py4
-rwxr-xr-xshare/spack/spack-completion.bash6
3 files changed, 15 insertions, 5 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',
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash
index 05ae403eb5..4eb1c1c038 100755
--- a/share/spack/spack-completion.bash
+++ b/share/spack/spack-completion.bash
@@ -407,9 +407,9 @@ function _spack_find {
if $list_options
then
compgen -W "-h --help -s --short -p --paths -d --deps -l --long
- -L --very-long -f --show-flags -e --explicit
- -E --implicit -u --unknown -m --missing -v --variants
- -M --only-missing -N --namespace" -- "$cur"
+ -L --very-long -f --show-flags --show-full-compiler
+ -e --explicit -E --implicit -u --unknown -m --missing
+ -v --variants -M --only-missing -N --namespace" -- "$cur"
else
compgen -W "$(_installed_packages)" -- "$cur"
fi