Fix indentation

This commit is contained in:
2022-06-28 17:16:31 -07:00
parent 50efef5f31
commit d1c7188528

4
bt.nim
View File

@@ -33,7 +33,7 @@ proc formatDepartures(etd: JSONNode): string =
styledEcho styleBright, name & " - " & now().format("H:mm") styledEcho styleBright, name & " - " & now().format("H:mm")
let maxDestLength = lines.map(proc (line: JSONNode) = line["destination"].getStr.len).foldl(max(a,b), 1) let maxDestLength = lines.getElems.map(proc (line: JSONNode): int = line["destination"].getStr.len).foldl(max(a,b), 1)
for line in lines: for line in lines:
let dest = line["destination"].getStr let dest = line["destination"].getStr
@@ -43,7 +43,7 @@ proc formatDepartures(etd: JSONNode): string =
if len(line["estimate"]) > 1: if len(line["estimate"]) > 1:
estimate = estimate & ", " & formatEstimateMinutes(line["estimate"][1]["minutes"].getStr) estimate = estimate & ", " & formatEstimateMinutes(line["estimate"][1]["minutes"].getStr)
styledEcho lineColor(color), &"{dest}\t\t{estimate}" styledEcho lineColor(color), dest & indent(estimate, max(maxDestLength + 3 - len(dest), 0))
proc usage() = proc usage() =
echo """bt - bart times cli echo """bt - bart times cli