Honor HideHelp and HideVersion

App.Run does not check a.Hide{Help,Version} before checking it,
as a result customers cannot define their own -v flag (e.g. for verbose)
This commit is contained in:
Nodir Turakulov 2015-09-27 23:42:17 -07:00
parent a65b733b30
commit c80fcac42b

4
app.go
View File

@ -123,11 +123,11 @@ func (a *App) Run(arguments []string) (err error) {
return nil
}
if checkHelp(context) {
if !a.HideHelp && checkHelp(context) {
return nil
}
if checkVersion(context) {
if !a.HideVersion && checkVersion(context) {
return nil
}