Improvements and WIP wc

This commit is contained in:
joachimschmidt557 2019-04-04 19:58:49 +02:00
parent 94c57b1da2
commit b7e5108379
10 changed files with 60 additions and 16 deletions

View file

@ -1,11 +1,11 @@
import cligen, sequtils
import common
proc main(strings:seq[string], newline=true) =
proc main(strings:seq[string], newline=true, nospaces=false) =
if newline:
writeLine(stdout, strings.foldl(a & " " & b))
writeLine(stdout, strings.foldl(a & (if nospaces: "" else: " ") & b))
else:
write(stdout, strings.foldl(a & " " & b))
write(stdout, strings.foldl(a & (if nospaces: "" else: " ") & b))
flushFile(stdout)
dispatch(main, version=("version", nimbaseVersion))