diff --git a/bt.nim b/bt.nim index f24dc06..1ee3125 100644 --- a/bt.nim +++ b/bt.nim @@ -33,7 +33,7 @@ proc formatDepartures(etd: JSONNode): string = 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: let dest = line["destination"].getStr @@ -43,7 +43,7 @@ proc formatDepartures(etd: JSONNode): string = if len(line["estimate"]) > 1: 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() = echo """bt - bart times cli