aboutsummaryrefslogtreecommitdiff
path: root/wa/utils
diff options
context:
space:
mode:
authorSergei Trofimov <sergei.trofimov@arm.com>2018-05-23 14:31:15 +0100
committerMarc Bonnici <marc.bonnici@arm.com>2018-05-23 14:51:54 +0100
commit2a2eafa2823d9215ca2b2a7dbbe273879d0e0590 (patch)
tree43458d3360f9a537115a1ab3121b5095aa22e5c0 /wa/utils
parent063212c2a9a3a0c7a05ae9d448135468c7d2a3d6 (diff)
utils/doc: include plugin aliases in the docs
If a plugin defines aliases, include the aliases and the parameter values they correspond to inside the docs.
Diffstat (limited to 'wa/utils')
-rw-r--r--wa/utils/doc.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/wa/utils/doc.py b/wa/utils/doc.py
index 2ae339a0..56fb39ff 100644
--- a/wa/utils/doc.py
+++ b/wa/utils/doc.py
@@ -294,6 +294,15 @@ def get_params_rst(parameters):
return text
+def get_aliases_rst(aliases):
+ text = ''
+ for alias in aliases:
+ param_str = ', '.join(['{}={}'.format(n, format_literal(v))
+ for n, v in alias.params.iteritems()])
+ text += '{}\n{}\n'.format(alias.name, indent(param_str))
+ return text
+
+
def underline(text, symbol='='):
return '{}\n{}\n\n'.format(text, symbol * len(text))
@@ -312,7 +321,13 @@ def get_rst_from_plugin(plugin):
else:
desc = ''
text += desc + '\n\n'
+
+ aliases_rst = get_aliases_rst(plugin.aliases)
+ if aliases_rst:
+ text += underline('aliases', '~') + aliases_rst
+
params_rst = get_params_rst(plugin.parameters)
if params_rst:
text += underline('parameters', '~') + params_rst
+
return text + '\n'