diff options
author | kitsunyan | 2018-06-03 00:36:08 +0000 |
---|---|---|
committer | kitsunyan | 2018-06-03 00:36:08 +0000 |
commit | 0b350aab70e5f3535d111d281586dd36174a0ed8 (patch) | |
tree | f5f32e2dbd0d63372c4c75be13250ea50cd7c582 /src/args.nim | |
parent | 1b3cca2815e8d8c3aa3fa11ed6cdccd7eae0421e (diff) |
Parse stdin as newline-separated instead of whitespace-separated
Diffstat (limited to 'src/args.nim')
-rw-r--r-- | src/args.nim | 3 |
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) |