]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/ceph_argparse: print flag name before CephChoices in help descs 40041/head
authorAdam King <adking@redhat.com>
Wed, 10 Mar 2021 22:01:04 +0000 (17:01 -0500)
committerAdam King <adking@redhat.com>
Fri, 12 Mar 2021 16:28:22 +0000 (11:28 -0500)
Fixes: https://tracker.ceph.com/issues/49757
Signed-off-by: Adam King <adking@redhat.com>
src/pybind/ceph_argparse.py

index 0b63731815c726c1302c1dc82ea1ce66af0fb167..9e5a42821777dc08459c5c5deaa3476d52371245 100644 (file)
@@ -830,8 +830,10 @@ 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:
+            chunk = f'--{self.name} {{{str(self.instance)}}}'
         elif self.t == CephOsdName:
             # it just so happens all CephOsdName commands are named 'id' anyway,
             # so <id|osd.id> is perfect.