From 6649e9d2e72532139d0ecf6f39f24a30a688ca46 Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Mon, 26 Oct 2020 07:55:09 +0800 Subject: [PATCH] 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. --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index ffd419c8..eebaf2f2 100644 --- a/main.go +++ b/main.go @@ -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 {