From: Sage Weil Date: Tue, 25 May 2021 14:53:01 +0000 (-0400) Subject: doc/_ext/ceph_commands: handle non-positional args in docs X-Git-Tag: v17.1.0~1726^2~6 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=295a5f282710efa7c3815faaa3919f1018d04066;p=ceph-ci.git doc/_ext/ceph_commands: handle non-positional args in docs Signed-off-by: Sage Weil --- diff --git a/doc/_ext/ceph_commands.py b/doc/_ext/ceph_commands.py index eec031ee3d2..046a5e09c39 100644 --- a/doc/_ext/ceph_commands.py +++ b/doc/_ext/ceph_commands.py @@ -82,7 +82,7 @@ class CmdParam(object): def __init__(self, type, name, who=None, n=None, req=True, range=None, strings=None, - goodchars=None): + goodchars=None, positional=True): self.type = type self.name = name self.who = who @@ -91,6 +91,7 @@ class CmdParam(object): self.range = range.split('|') if range else [] self.strings = strings.split('|') if strings else [] self.goodchars = goodchars + self.positional = positional != 'false' assert who == None @@ -200,7 +201,7 @@ TEMPLATE = ''' {%- if command.params %} :Parameters:{% for param in command.params -%} -{{" -" | indent(12, not loop.first) }} **{{param.name}}**: {{ param.help() }} +{{" -" | indent(12, not loop.first) }} **{% if param.positional %}{{param.name}}{% else %}--{{param.name}}{% endif %}**: {{ param.help() }} {% endfor %} {% endif %} :Ceph Module: {{ command.module }}