summaryrefslogtreecommitdiff
path: root/usage.go
diff options
context:
space:
mode:
authorAlex Flint <[email protected]>2015-11-09 10:04:37 -0800
committerAlex Flint <[email protected]>2015-11-09 10:04:37 -0800
commita49bba8533235e33cb82893851edcbc2805a4b77 (patch)
treed214a56d88f88d06d7dda7a7ede777054d7d424f /usage.go
parenta6c77a413a4c616d5e6f4bcd5d7480e1dcb86465 (diff)
parent935b2a1bd5710aede269d46752e59fba916abaea (diff)
Merge pull request #10 from walle/fail_to_stderr
Write usage message to stderr on error
Diffstat (limited to 'usage.go')
-rw-r--r--usage.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/usage.go b/usage.go
index 723719a..13134d0 100644
--- a/usage.go
+++ b/usage.go
@@ -9,9 +9,9 @@ import (
"strings"
)
-// Fail prints usage information to stdout and exits with non-zero status
+// Fail prints usage information to stderr and exits with non-zero status
func (p *Parser) Fail(msg string) {
- p.WriteUsage(os.Stdout)
+ p.WriteUsage(os.Stderr)
fmt.Println("error:", msg)
os.Exit(-1)
}