From 0b350aab70e5f3535d111d281586dd36174a0ed8 Mon Sep 17 00:00:00 2001 From: kitsunyan Date: Sun, 3 Jun 2018 03:36:08 +0300 Subject: Parse stdin as newline-separated instead of whitespace-separated --- src/args.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3-70-g09d2