Print out usage message to STDERR
`flag.PrintDefaults()` writes to `os.Stderr`, therefore the "Usage" part should go there as well.
This commit is contained in:
parent
4ab47545f7
commit
d506dad041
@ -30,7 +30,7 @@ var args struct {
|
|||||||
func init() {
|
func init() {
|
||||||
flag.DurationVar(&args.DBOpenTimeout, "timeout", DefaultDBOpenTimeout, "DB file open timeout")
|
flag.DurationVar(&args.DBOpenTimeout, "timeout", DefaultDBOpenTimeout, "DB file open timeout")
|
||||||
flag.Usage = func() {
|
flag.Usage = func() {
|
||||||
fmt.Fprintf(os.Stdout, "Usage: %s [OPTIONS] <filename(s)>\nOptions:\n", ProgramName)
|
fmt.Fprintf(os.Stderr, "Usage: %s [OPTIONS] <filename(s)>\nOptions:\n", ProgramName)
|
||||||
flag.PrintDefaults()
|
flag.PrintDefaults()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user