Change nargs='*' to argparse.REMAINDER for constraint options. (#2798)

This commit is contained in:
Todd Gamblin 2017-01-10 12:25:41 -08:00 committed by GitHub
parent a7a77b5b41
commit f5557b5723
2 changed files with 3 additions and 2 deletions

View file

@ -75,7 +75,7 @@ def _specs(self, **kwargs):
_arguments['constraint'] = Args( _arguments['constraint'] = Args(
'constraint', nargs='*', action=ConstraintAction, 'constraint', nargs=argparse.REMAINDER, action=ConstraintAction,
help='Constraint to select a subset of installed packages') help='Constraint to select a subset of installed packages')
_arguments['module_type'] = Args( _arguments['module_type'] = Args(

View file

@ -117,7 +117,8 @@ def find(parser, args):
# Exit early if no package matches the constraint # Exit early if no package matches the constraint
if not query_specs and args.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) tty.msg(msg)
return return