Browse Source
Fix bug with error not being written to stderr
Only the usage message was written to stderr, the error was written with
the standard fmt.Println.
Fredrik Wallgren
10 years ago
No known key found for this signature in database
GPG Key ID: F47F4EC105BDC53E
1 changed files with
1 additions and
1 deletions
-
usage.go
|
|
|
@ -12,7 +12,7 @@ import ( |
|
|
|
// Fail prints usage information to stderr and exits with non-zero status
|
|
|
|
func (p *Parser) Fail(msg string) { |
|
|
|
p.WriteUsage(os.Stderr) |
|
|
|
fmt.Println("error:", msg) |
|
|
|
fmt.Fprintln(os.Stderr, "error:", msg) |
|
|
|
os.Exit(-1) |
|
|
|
} |
|
|
|
|
|
|
|
|