From 0883aa5b449177f1100c73b347de5c09e04b91a2 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Sat, 27 Aug 2016 18:58:20 +0200 Subject: [PATCH] cli: Fix stdin help text being show multiple times Also remove '\n' from msgStdinInfo as we use Fprintln. License: MIT Signed-off-by: Jakub Sztandera --- commands/cli/parse.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/cli/parse.go b/commands/cli/parse.go index 672144a78..b03f7d994 100644 --- a/commands/cli/parse.go +++ b/commands/cli/parse.go @@ -251,7 +251,7 @@ func parseOpts(args []string, root *cmds.Command) ( return } -const msgStdinInfo = "ipfs: Reading from %s; send Ctrl-d to stop.\n" +const msgStdinInfo = "ipfs: Reading from %s; send Ctrl-d to stop." func parseArgs(inputs []string, stdin *os.File, argDefs []cmds.Argument, recursive, hidden bool, root *cmds.Command) ([]string, []files.File, error) { // ignore stdin on Windows @@ -469,6 +469,7 @@ func newMessageReader(r io.ReadCloser, msg string) io.ReadCloser { func (r *messageReader) Read(b []byte) (int, error) { if !r.done { fmt.Fprintln(os.Stderr, r.message) + r.done = true } return r.r.Read(b)