From d506dad041f0bfd1bbe03efa6e91729afd28edb8 Mon Sep 17 00:00:00 2001 From: Andrew Slotin Date: Fri, 13 Oct 2017 19:01:54 +0700 Subject: [PATCH] Print out usage message to STDERR `flag.PrintDefaults()` writes to `os.Stderr`, therefore the "Usage" part should go there as well. --- boltbrowser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boltbrowser.go b/boltbrowser.go index 19fa968..2a21b22 100644 --- a/boltbrowser.go +++ b/boltbrowser.go @@ -30,7 +30,7 @@ var args struct { func init() { flag.DurationVar(&args.DBOpenTimeout, "timeout", DefaultDBOpenTimeout, "DB file open timeout") flag.Usage = func() { - fmt.Fprintf(os.Stdout, "Usage: %s [OPTIONS] \nOptions:\n", ProgramName) + fmt.Fprintf(os.Stderr, "Usage: %s [OPTIONS] \nOptions:\n", ProgramName) flag.PrintDefaults() } }