From c94933343a9459503dc95628a4c0bd09fdcb60ac Mon Sep 17 00:00:00 2001 From: Matthew Scott Krafczyk Date: Mon, 28 Aug 2017 12:35:46 -0500 Subject: 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. --- lib/spack/spack/cmd/__init__.py | 10 ++++++++-- lib/spack/spack/cmd/find.py | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'lib') 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', -- cgit v1.2.3-70-g09d2