mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-05 20:48: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})
|
panic(jiracli.Exit{Code: 1})
|
||||||
})
|
})
|
||||||
_, err := app.Parse(os.Args[1:])
|
if _, err := app.Parse(os.Args[1:]); err != nil {
|
||||||
if err != nil {
|
ctx, _ := app.ParseContext(os.Args[1:])
|
||||||
log.Fatalf("%s", err)
|
if ctx != nil {
|
||||||
|
app.UsageForContext(ctx)
|
||||||
|
}
|
||||||
|
log.Errorf("Invalid Usage: %s", err)
|
||||||
|
panic(jiracli.Exit{Code: 1})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user