Commit 8d6bfec8 authored by Christian Couder's avatar Christian Couder

parse: improve stdin fix

License: MIT
Signed-off-by: default avatarChristian Couder <chriscool@tuxfamily.org>
parent 2eea1b05
......@@ -223,7 +223,7 @@ func parseArgs(inputs []string, stdin *os.File, argDefs []cmds.Argument, recursi
// if there is at least one ArgDef, we can safely trigger the inputs loop
// below to parse stdin.
numInputs := len(inputs)
if argDef := getArgDef(0, argDefs); argDef != nil && stdin != nil {
if len(argDefs) > 0 && stdin != nil {
numInputs += 1
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment