Fix quoted switch, multi-line description, more caching (#642)

* Fix quoted switch, multi-line description, more caching

* Incorporate feedback
This commit is contained in:
genotrance 2019-04-30 14:59:12 -05:00 committed by Dominik Picheta
commit ca779afb20
3 changed files with 15 additions and 15 deletions

View file

@ -75,7 +75,7 @@ template `--`*(key: untyped) =
template printIfLen(varName) =
if varName.len != 0:
iniOut &= astToStr(varName) & ": \"" & varName & "\"\n"
iniOut &= astToStr(varName) & ": \"\"\"" & varName & "\"\"\"\n"
template printSeqIfLen(varName) =
if varName.len != 0:
@ -128,7 +128,9 @@ proc onExit*() =
for key, val in flags.pairs:
output &= "\"" & key & "\": ["
for v in val:
output &= "\"" & v & "\", "
let v = if v.len > 0 and v[0] == '"': strutils.unescape(v)
else: v
output &= v.escape & ", "
output = output[0 .. ^3] & "], "
output = output[0 .. ^3] & "}, "