From: Adam King Date: Mon, 15 Mar 2021 17:29:46 +0000 (-0400) Subject: pybind/ceph_argparse: print --format flag name in help descs X-Git-Tag: v16.2.2~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ae1edab99f3318f28d2a5dda6071b57258ed9285;p=ceph.git pybind/ceph_argparse: print --format flag name in help descs Fixes: https://tracker.ceph.com/issues/49757 Signed-off-by: Adam King (cherry picked from commit 97825298b99121d8ac877eaec16d3983549f30ee) --- diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py index 0b63731815c7..f58fca3afd80 100644 --- a/src/pybind/ceph_argparse.py +++ b/src/pybind/ceph_argparse.py @@ -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 is perfect.