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 <kubuxu@protonmail.ch>
Jakub Sztandera committed
Aug 27, 2016 at 18:58 UTC
0883aa5b449177f1100c73b347de5c09e04b91a2
1 file changed
+2
-1
commands/cli/parse.go
+2
-1
@@ -251,7 +251,7 @@ func parseOpts(args []string, root *cmds.Command) (
251
return
252
}
253
254
-const msgStdinInfo = "ipfs: Reading from %s; send Ctrl-d to stop.\n"
254
+const msgStdinInfo = "ipfs: Reading from %s; send Ctrl-d to stop."
255
256
func parseArgs(inputs []string, stdin *os.File, argDefs []cmds.Argument, recursive, hidden bool, root *cmds.Command) ([]string, []files.File, error) {
257
// ignore stdin on Windows
@@ -469,6 +469,7 @@ func newMessageReader(r io.ReadCloser, msg string) io.ReadCloser {
469
func (r *messageReader) Read(b []byte) (int, error) {
470
if !r.done {
471
fmt.Fprintln(os.Stderr, r.message)
472
+ r.done = true
473
}
474
475
return r.r.Read(b)