A few tweaks based on feedback in #361

This commit is contained in:
Dan Buch 2016-04-29 03:01:57 -04:00
parent 4cae17cfe1
commit 06c01a4bba
No known key found for this signature in database
GPG Key ID: FAEF12936DD3E3EC

8
app.go
View File

@ -14,11 +14,13 @@ import (
var ( var (
appActionDeprecationURL = "https://github.com/codegangsta/cli/blob/master/CHANGELOG.md#deprecated-cli-app-action-signature" appActionDeprecationURL = "https://github.com/codegangsta/cli/blob/master/CHANGELOG.md#deprecated-cli-app-action-signature"
contactSysadmin = "This is an error in the application. Please contact the distributor of this application if this is not you."
errNonFuncAction = NewExitError("ERROR invalid Action type. "+ errNonFuncAction = NewExitError("ERROR invalid Action type. "+
"Must be a func of type `cli.ActionFunc`. "+ fmt.Sprintf("Must be a func of type `cli.ActionFunc`. %s", contactSysadmin)+
fmt.Sprintf("See %s", appActionDeprecationURL), 2) fmt.Sprintf("See %s", appActionDeprecationURL), 2)
errInvalidActionSignature = NewExitError("ERROR invalid Action signature. "+ errInvalidActionSignature = NewExitError("ERROR invalid Action signature. "+
"Must be `cli.ActionFunc`. "+ fmt.Sprintf("Must be `cli.ActionFunc`. %s", contactSysadmin)+
fmt.Sprintf("See %s", appActionDeprecationURL), 2) fmt.Sprintf("See %s", appActionDeprecationURL), 2)
) )
@ -419,7 +421,7 @@ func HandleAction(action interface{}, context *Context) (err error) {
if len(vals) == 0 { if len(vals) == 0 {
fmt.Fprintln(os.Stderr, fmt.Fprintln(os.Stderr,
"DEPRECATED Action signature. Must be `cli.ActionFunc`") "DEPRECATED Action signature. Must be `cli.ActionFunc`")
return err return nil
} }
if len(vals) > 1 { if len(vals) > 1 {