From: Luo Kexue Date: Tue, 12 Sep 2017 07:20:04 +0000 (+0800) Subject: pybind/ceph_argparse: fix cli output info X-Git-Tag: v13.0.1~908^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3a1ea8d5e01d364f66e61e1d69aaa9f7a9ec9365;p=ceph-ci.git pybind/ceph_argparse: fix cli output info Signed-off-by: Luo Kexue --- diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py index cc96d7708dc..b910877e605 100644 --- a/src/pybind/ceph_argparse.py +++ b/src/pybind/ceph_argparse.py @@ -1073,8 +1073,9 @@ def validate_command(sigdict, args, verbose=False): break if not found: - print('no valid command found; 10 closest matches:', file=sys.stderr) - for cmdsig in bestcmds[:10]: + bestcmds = bestcmds[:10] + print('no valid command found; {0} closest matches:'.format(len(bestcmds)), file=sys.stderr) + for cmdsig in bestcmds: for (cmdtag, cmd) in cmdsig.items(): print(concise_sig(cmd['sig']), file=sys.stderr) return None