aboutsummaryrefslogtreecommitdiff
path: root/src/args.nim
diff options
context:
space:
mode:
authorkitsunyan2018-06-03 00:36:08 +0000
committerkitsunyan2018-06-03 00:36:08 +0000
commit0b350aab70e5f3535d111d281586dd36174a0ed8 (patch)
treef5f32e2dbd0d63372c4c75be13250ea50cd7c582 /src/args.nim
parent1b3cca2815e8d8c3aa3fa11ed6cdccd7eae0421e (diff)
Parse stdin as newline-separated instead of whitespace-separated
Diffstat (limited to 'src/args.nim')
-rw-r--r--src/args.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/args.nim b/src/args.nim
index 0aba17c..5a3bd04 100644
--- a/src/args.nim
+++ b/src/args.nim
@@ -59,7 +59,8 @@ proc splitArgs*(params: seq[string],
if stdinConsumed or isatty(0) == 1:
raise commandError(trp("argument '-' specified without input on stdin\n").strip)
else:
- let args = lc[x | (y <- readLines(), x <- y.splitWhitespace), string]
+ let args = toSeq(readLines())
+ .filter(s => s.len > 0)
.map(s => (s, none(string), ArgumentType.target))
return (args, next, true, endOfOpts)