]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
doc/_ext/ceph_commands: handle non-positional args in docs
authorSage Weil <sage@newdream.net>
Tue, 25 May 2021 14:53:01 +0000 (10:53 -0400)
committerSage Weil <sage@newdream.net>
Fri, 4 Jun 2021 20:56:17 +0000 (16:56 -0400)
Signed-off-by: Sage Weil <sage@newdream.net>
doc/_ext/ceph_commands.py

index eec031ee3d2ab088380e8d2e06a49369e625910e..046a5e09c398cc3622cac4ecc93edc041f273b7d 100644 (file)
@@ -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 }}