mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-18 20:23:28 +02:00
add better handing for usage error
This commit is contained in:
+7
-3
@@ -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})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user