Skip to content

Commit

Permalink
add better handing for usage error
Browse files Browse the repository at this point in the history
  • Loading branch information
coryb committed Aug 22, 2017
1 parent 56b1c9d commit b235dcc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmd/jira/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,12 @@ func main() {
}
panic(jiracli.Exit{Code: 1})
})
_, err := app.Parse(os.Args[1:])
if err != nil {
log.Fatalf("%s", err)
if _, err := app.Parse(os.Args[1:]); err != nil {
ctx, _ := app.ParseContext(os.Args[1:])
if ctx != nil {
app.UsageForContext(ctx)
}
log.Errorf("Invalid Usage: %s", err)
panic(jiracli.Exit{Code: 1})
}
}

0 comments on commit b235dcc

Please sign in to comment.