From 8d6bfec890c9687eaebcb7ae43cc1b9b2e9f9d7f Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Wed, 20 May 2015 21:28:41 +0200 Subject: [PATCH] parse: improve stdin fix License: MIT Signed-off-by: Christian Couder --- commands/cli/parse.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/cli/parse.go b/commands/cli/parse.go index 4ff7103a0..11003335e 100644 --- a/commands/cli/parse.go +++ b/commands/cli/parse.go @@ -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 }