♻️ Better options

This commit is contained in:
Nikhil Badyal
2025-03-20 18:06:11 +05:30
parent e3bec934c4
commit f9880331c0
+5
View File
@@ -45,6 +45,11 @@ class Parser(object):
if value := opt.get("value"):
if isinstance(value, bool):
pair += f'="{str(value).lower()}"'
elif isinstance(value, (int, float)):
pair += f"={value}" # Numbers should not be quoted
elif isinstance(value, list):
formatted_list = ",".join(map(str, value))
pair += f'="[ {formatted_list} ]"' # Preserve list format
else:
pair += f'="{value}"'
return pair