]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/ceph_argparse: print --format flag name in help descs 40922/head
authorAdam King <adking@redhat.com>
Mon, 15 Mar 2021 17:29:46 +0000 (13:29 -0400)
committerSage Weil <sage@newdream.net>
Fri, 23 Apr 2021 12:24:15 +0000 (07:24 -0500)
Fixes: https://tracker.ceph.com/issues/49757
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 97825298b99121d8ac877eaec16d3983549f30ee)

src/pybind/ceph_argparse.py

index 0b63731815c726c1302c1dc82ea1ce66af0fb167..f58fca3afd80016d3f4fe4ad31b5894e7ac5b26b 100644 (file)
@@ -830,8 +830,13 @@ class argdesc(object):
         """
         if self.t == CephBool:
             chunk = "--{0}".format(self.name.replace("_", "-"))
-        elif self.t == CephPrefix or self.t == CephChoices:
+        elif self.t == CephPrefix:
             chunk = str(self.instance)
+        elif self.t == CephChoices:
+            if self.name == 'format':
+                chunk = f'--{self.name} {{{str(self.instance)}}}'
+            else:
+                chunk = str(self.instance)
         elif self.t == CephOsdName:
             # it just so happens all CephOsdName commands are named 'id' anyway,
             # so <id|osd.id> is perfect.