From: Dan Mick Date: Sat, 3 Aug 2013 03:46:00 +0000 (-0700) Subject: ceph_argparse.py: add stderr note if nonrequired param is invalid X-Git-Tag: v0.67~29 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=71ff794eca7dd57a0b0473530f685069ac9987f0;p=ceph.git ceph_argparse.py: add stderr note if nonrequired param is invalid If we run across a user-supplied parameter that doesn't validate against a non-required descriptor, it may be that it's a valid entry for a later descriptor...or it may be that it's supposed to match. We can't really tell. A possible heuristic would be to call it invalid-for-sure if we're at the end of the descriptor list, but that's not very generic. Warn about it and try to drive on anyway. Signed-off-by: Dan Mick Reviewed-by: Sage Weil --- diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py index 0537f3249684..2a6fe6e4d023 100644 --- a/src/pybind/ceph_argparse.py +++ b/src/pybind/ceph_argparse.py @@ -845,6 +845,7 @@ def validate(args, signature, partial=False): if not desc.req: # if not required, just push back; it might match # the next arg + print >> sys.stderr, myarg, 'not valid: ', str(e) myargs.insert(0, myarg) break else: