mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-23 06:18:31 +02:00
use jiracli.Error object to disambiguate between kingpin errors and cli errors
This commit is contained in:
+10
-5
@@ -329,11 +329,16 @@ func main() {
|
||||
}
|
||||
}
|
||||
if _, err := app.Parse(os.Args[1:]); err != nil {
|
||||
ctx, _ := app.ParseContext(os.Args[1:])
|
||||
if ctx != nil {
|
||||
app.UsageForContext(ctx)
|
||||
if _, ok := err.(*jiracli.Error); ok {
|
||||
log.Errorf("%s", err)
|
||||
panic(jiracli.Exit{Code: 1})
|
||||
} else {
|
||||
ctx, _ := app.ParseContext(os.Args[1:])
|
||||
if ctx != nil {
|
||||
app.UsageForContext(ctx)
|
||||
}
|
||||
log.Errorf("Invalid Usage: %s", err)
|
||||
panic(jiracli.Exit{Code: 1})
|
||||
}
|
||||
log.Errorf("Invalid Usage: %s", err)
|
||||
panic(jiracli.Exit{Code: 1})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user