From 3a1ea8d5e01d364f66e61e1d69aaa9f7a9ec9365 Mon Sep 17 00:00:00 2001 From: Luo Kexue Date: Tue, 12 Sep 2017 15:20:04 +0800 Subject: [PATCH] pybind/ceph_argparse: fix cli output info Signed-off-by: Luo Kexue --- src/pybind/ceph_argparse.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py index cc96d7708dc9..b910877e605f 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 -- 2.47.3