From f5557b572366c420f9f7e63c8a7fd6888cf1d88d Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 10 Jan 2017 12:25:41 -0800 Subject: [PATCH] Change nargs='*' to argparse.REMAINDER for constraint options. (#2798) --- lib/spack/spack/cmd/common/arguments.py | 2 +- lib/spack/spack/cmd/find.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/spack/spack/cmd/common/arguments.py b/lib/spack/spack/cmd/common/arguments.py index 53e75a4f2c..f091b9cf75 100644 --- a/lib/spack/spack/cmd/common/arguments.py +++ b/lib/spack/spack/cmd/common/arguments.py @@ -75,7 +75,7 @@ def _specs(self, **kwargs): _arguments['constraint'] = Args( - 'constraint', nargs='*', action=ConstraintAction, + 'constraint', nargs=argparse.REMAINDER, action=ConstraintAction, help='Constraint to select a subset of installed packages') _arguments['module_type'] = Args( diff --git a/lib/spack/spack/cmd/find.py b/lib/spack/spack/cmd/find.py index ab0b29c30e..ecd6ae2822 100644 --- a/lib/spack/spack/cmd/find.py +++ b/lib/spack/spack/cmd/find.py @@ -117,7 +117,8 @@ def find(parser, args): # Exit early if no package matches the constraint if not query_specs and args.constraint: - msg = "No package matches the query: {0}".format(args.constraint) + msg = "No package matches the query: {0}".format( + ' '.join(args.constraint)) tty.msg(msg) return