Skip to content

Commit

Permalink
Merge pull request ceph#40124 from adk3798/format-help
Browse files Browse the repository at this point in the history
pybind/ceph_argparse: print --format flag name in help descs

Reviewed-by: Michael Fritch <[email protected]>
  • Loading branch information
tchaikov authored Apr 3, 2021
2 parents 9541a97 + 9782529 commit 7fb0569
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pybind/ceph_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,13 @@ def helpstr(self):
"""
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.
Expand Down

0 comments on commit 7fb0569

Please sign in to comment.