summaryrefslogtreecommitdiff
path: root/tools/manpage.py
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2017-07-26 01:34:57 +0200
committerLinus Nordberg <linus@nordu.net>2017-07-26 13:19:39 +0200
commit4f8f473db95c2262c3f387aed3d4459555ac52e2 (patch)
tree9a4f3706779c7b0a5c4ea17c06305e1b263ae7a0 /tools/manpage.py
parente0be874a28c9ee9c9b07e3cff89301cd58cfd31f (diff)
Output optional and defaults to configuration man page
Diffstat (limited to 'tools/manpage.py')
-rw-r--r--tools/manpage.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/manpage.py b/tools/manpage.py
index 1ea8753..d8ce09f 100644
--- a/tools/manpage.py
+++ b/tools/manpage.py
@@ -23,7 +23,7 @@ def traverse_schema_part(schema):
schema_part = schema.get(k)
result = None
if isinstance(schema_part, tuple):
- (lowleveldatatype, highleveldatatype) = schema_part
+ (lowleveldatatype, highleveldatatype, extra) = schema_part
if isinstance(highleveldatatype, list):
formatted_datatype = "|".join(["**"+t+"**" for t in highleveldatatype])
else:
@@ -33,6 +33,13 @@ def traverse_schema_part(schema):
else:
result = "**" + k + "**: " + formatted_datatype
+ if extra["optional"]:
+ result += " (optional)"
+
+ default = extra["default"]
+ if default != None:
+ result += " (default: %s)" % (default)
+
tree.add(k, (result, []))
elif isinstance(schema_part, dict):