]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/ceph_argparse: fix cli output info
authorLuo Kexue <luo.kexue@zte.com.cn>
Tue, 12 Sep 2017 07:20:04 +0000 (15:20 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 1 Mar 2018 09:23:05 +0000 (17:23 +0800)
Signed-off-by: Luo Kexue <luo.kexue@zte.com.cn>
(cherry picked from commit 3a1ea8d5e01d364f66e61e1d69aaa9f7a9ec9365)

src/pybind/ceph_argparse.py

index 3855135df6bd6b3c1aa808bb4fc68eb7e2dcb03d..6582931f0f35e2b2f1b5dbbffe2baf3a27134310 100644 (file)
@@ -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