Make explicit "mkcert -help" print to stdout (#265)

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.
This commit is contained in:
Martin Tournoij 2020-10-26 07:55:09 +08:00 committed by GitHub
parent 3fa4d18f75
commit 6649e9d2e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 {