Skip to content

Commit 050985c

Browse files
Merge pull request #3134 from ipfs/fix/cmd/repeated-help-text
cli: Fix stdin help text being show multiple times
2 parents 685cd28 + 0883aa5 commit 050985c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

commands/cli/parse.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ func parseOpts(args []string, root *cmds.Command) (
251251
return
252252
}
253253

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."
255255

256256
func parseArgs(inputs []string, stdin *os.File, argDefs []cmds.Argument, recursive, hidden bool, root *cmds.Command) ([]string, []files.File, error) {
257257
// ignore stdin on Windows
@@ -469,6 +469,7 @@ func newMessageReader(r io.ReadCloser, msg string) io.ReadCloser {
469469
func (r *messageReader) Read(b []byte) (int, error) {
470470
if !r.done {
471471
fmt.Fprintln(os.Stderr, r.message)
472+
r.done = true
472473
}
473474

474475
return r.r.Read(b)

0 commit comments

Comments
 (0)