From 332abcd25059c3ed07ca5df54110a83e07f28f86 Mon Sep 17 00:00:00 2001 From: Adam King Date: Wed, 10 Mar 2021 17:01:04 -0500 Subject: [PATCH] pybind/ceph_argparse: print flag name before CephChoices in help descs Fixes: https://tracker.ceph.com/issues/49757 Signed-off-by: Adam King --- src/pybind/ceph_argparse.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py index 0b63731815c72..9e5a42821777d 100644 --- a/src/pybind/ceph_argparse.py +++ b/src/pybind/ceph_argparse.py @@ -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 is perfect. -- 2.39.5