diff options
author | Dan Mick <dan.mick@inktank.com> | 2013-08-02 20:46:00 -0700 |
---|---|---|
committer | Dan Mick <dan.mick@inktank.com> | 2013-08-05 11:20:36 -0700 |
commit | 71ff794eca7dd57a0b0473530f685069ac9987f0 (patch) | |
tree | 3b92f8a4c8f3e6183130ff2da2dd6f09bb863201 | |
parent | 9466a0b152beeab894be66c6528495ca01a1974a (diff) | |
download | ceph-71ff794eca7dd57a0b0473530f685069ac9987f0.tar.gz |
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 <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/pybind/ceph_argparse.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py index 0537f324968..2a6fe6e4d02 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: |