1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-05-21 00:47:22 +08:00

parse: improve stdin fix

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
This commit is contained in:
Christian Couder
2015-05-20 21:28:41 +02:00
parent 2eea1b05b7
commit 8d6bfec890

View File

@ -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
}