From fdc6081244d0d95793c23a5295edc580096ad351 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 2 Dec 2014 22:52:53 -0800 Subject: CLI improvements to find and list. --- lib/spack/spack/cmd/find.py | 16 +++++++++++----- lib/spack/spack/cmd/list.py | 1 - 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/cmd/find.py b/lib/spack/spack/cmd/find.py index b6efc980b6..1de3413d42 100644 --- a/lib/spack/spack/cmd/find.py +++ b/lib/spack/spack/cmd/find.py @@ -40,12 +40,15 @@ description ="Find installed spack packages" def setup_parser(subparser): format_group = subparser.add_mutually_exclusive_group() + format_group.add_argument( + '-l', '--long', action='store_true', dest='long', + help='Show dependency hashes as well as versions.') format_group.add_argument( '-p', '--paths', action='store_true', dest='paths', help='Show paths to package install directories') format_group.add_argument( - '-l', '--long', action='store_true', dest='full_specs', - help='Show full-length specs of installed packages') + '-d', '--deps', action='store_true', dest='full_deps', + help='Show full dependency DAG of installed packages') subparser.add_argument( 'query_specs', nargs=argparse.REMAINDER, @@ -88,7 +91,7 @@ def find(parser, args): specs = index[(architecture,compiler)] specs.sort() - abbreviated = [s.format('$_$@$+$#', color=True) for s in specs] + abbreviated = [s.format('$_$@$+', color=True) for s in specs] if args.paths: # Print one spec per line along with prefix path width = max(len(s) for s in abbreviated) @@ -98,8 +101,11 @@ def find(parser, args): for abbrv, spec in zip(abbreviated, specs): print format % (abbrv, spec.prefix) - elif args.full_specs: + elif args.full_deps: for spec in specs: print spec.tree(indent=4, format='$_$@$+', color=True), else: - colify(s.format('$-_$@$+$#', color=True) for s in specs) + fmt = '$-_$@$+' + if args.long: + fmt += '$#' + colify(s.format(fmt, color=True) for s in specs) diff --git a/lib/spack/spack/cmd/list.py b/lib/spack/spack/cmd/list.py index 5c7051d6a9..1f0978a18e 100644 --- a/lib/spack/spack/cmd/list.py +++ b/lib/spack/spack/cmd/list.py @@ -61,5 +61,4 @@ def list(parser, args): indent=0 if sys.stdout.isatty(): tty.msg("%d packages." % len(sorted_packages)) - indent=2 colify(sorted_packages, indent=indent) -- cgit v1.2.3-70-g09d2