From 6fdb7b3aa08b263e735382e115f25f2dab75851e Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Thu, 21 May 2020 00:50:06 +0800 Subject: [PATCH] Make mkcert -help print to stdout instead of stderr 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 23be39e5..0705a10c 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 {