Skip to content

Commit

Permalink
Fix short write error on help
Browse files Browse the repository at this point in the history
  • Loading branch information
rs committed Aug 4, 2018
1 parent e5ff162 commit d4ae23f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion formatter/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ type HelpAdapter struct {
}

func (j HelpAdapter) Write(p []byte) (n int, err error) {
n = len(p)
cmd := "http"
if len(j.CmdName) == 0 {
cmd = j.CmdName
}
p = bytes.Replace(p,
[]byte("curl [options...] <url>"),
[]byte(cmd+" [options...] [METHOD] URL [REQUEST_ITEM [REQUEST_ITEM ...]]"), 1)
return j.Out.Write(p)
_, err = j.Out.Write(p)
return
}

0 comments on commit d4ae23f

Please sign in to comment.