Skip to content

Commit

Permalink
Merge pull request #3134 from ipfs/fix/cmd/repeated-help-text
Browse files Browse the repository at this point in the history
cli: Fix stdin help text being show multiple times
  • Loading branch information
whyrusleeping authored Aug 29, 2016
2 parents 685cd28 + 0883aa5 commit 050985c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commands/cli/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 050985c

Please sign in to comment.