mirror of
https://github.com/ceph/ceph
synced 2025-02-20 17:37:29 +00:00
doc/_ext/ceph_commands: handle non-positional args in docs
Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
c70a4f583c
commit
295a5f2827
@ -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 }}
|
||||
|
Loading…
Reference in New Issue
Block a user