1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 19:44:01 +08:00

parse: don't use stdin if there are arguments

This should fix issue #1141 (ipfs cat "multihash too short"
error when using stdin) and perhaps others.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
This commit is contained in:
Christian Couder
2015-05-17 20:54:07 +02:00
parent ff9cb9ecf4
commit 97ab64af30
2 changed files with 18 additions and 9 deletions

View File

@ -222,8 +222,8 @@ func TestArgumentParsing(t *testing.T) {
fstdin := fileToSimulateStdin(t, "stdin1")
test([]string{"stdinenabled"}, fstdin, []string{"stdin1"})
test([]string{"stdinenabled", "value1"}, fstdin, []string{"stdin1", "value1"})
test([]string{"stdinenabled", "value1", "value2"}, fstdin, []string{"stdin1", "value1", "value2"})
test([]string{"stdinenabled", "value1"}, fstdin, []string{"value1"})
test([]string{"stdinenabled", "value1", "value2"}, fstdin, []string{"value1", "value2"})
fstdin = fileToSimulateStdin(t, "stdin1\nstdin2")
test([]string{"stdinenabled"}, fstdin, []string{"stdin1", "stdin2"})