Browse Source

Merge pull request #10 from walle/fail_to_stderr

Write usage message to stderr on error
Alex Flint 10 years ago
parent
commit
a49bba8533
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      usage.go

+ 2
- 2
usage.go View File

@ -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)
}


Loading…
Cancel
Save