Fix rendering of Booleans

This commit is contained in:
Luc Perkins 2025-05-15 16:32:20 -04:00
parent 44b49325b1
commit 7bdbe146aa
No known key found for this signature in database
GPG key ID: C86EE5D85EE4DDA5
2 changed files with 13 additions and 7 deletions

View file

@ -8,7 +8,6 @@ import sys
def eprintln(line):
print(line, file=sys.stderr)
def make_inputs_table(inputs):
headers = ["Parameter", "Description", "Required", "Default"]
rows = []
@ -16,12 +15,19 @@ def make_inputs_table(inputs):
required = input_options.get("required", False)
default = input_options.get("default")
if isinstance(default, bool):
default_str = f"`{str(default).lower()}`"
elif default is not None:
default_str = f"`{default}`"
else:
default_str = ""
rows.append(
[
f"`{input_name}`",
input_options["description"],
"📍" if required else "",
f"`{default}`" if default is not None else "",
default_str,
]
)