Skip to content

Commit

Permalink
Make explicit "mkcert -help" print to stdout (#265)
Browse files Browse the repository at this point in the history
Currently "mkcert -help" prints to stderr, which is rather annoying as:

	$ mkcert -help | less

Gives us a blank page, as it pipes only stdout. To get any results in
less I need to use:

	$ mkcert 2>&1 | less
	$ mkcert |& less     # Non-standard bash/ zsh

Since the user explicitly asked for help with -help, it doesn't make
much sense to output it to stderr IMHO.
  • Loading branch information
arp242 committed Oct 25, 2020
1 parent 3fa4d18 commit 6649e9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ func main() {
}
flag.Parse()
if *helpFlag {
fmt.Fprint(flag.CommandLine.Output(), shortUsage)
fmt.Fprint(flag.CommandLine.Output(), advancedUsage)
fmt.Print(shortUsage)
fmt.Print(advancedUsage)
return
}
if *versionFlag {
Expand Down

0 comments on commit 6649e9d

Please sign in to comment.