From ae1edab99f3318f28d2a5dda6071b57258ed9285 Mon Sep 17 00:00:00 2001 From: Adam King Date: Mon, 15 Mar 2021 13:29:46 -0400 Subject: [PATCH] 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) --- src/pybind/ceph_argparse.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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. -- 2.47.3