@@ -62,9 +62,9 @@ type App struct {
6262 // It is run even if Action() panics
6363 After AfterFunc
6464 // The action to execute when no subcommands are specified
65+ // Expects a `cli.ActionFunc` but will accept the *deprecated* signature of `func(*cli.Context) {}`
66+ // *Note*: support for the deprecated `Action` signature will be removed in a future version
6567 Action interface {}
66- // TODO: replace `Action: interface{}` with `Action: ActionFunc` once some kind
67- // of deprecation period has passed, maybe?
6868
6969 // Execute this function if the proper command cannot be found
7070 CommandNotFound CommandNotFoundFunc
@@ -226,11 +226,12 @@ func (a *App) Run(arguments []string) (err error) {
226226 return err
227227}
228228
229- // DEPRECATED: Another entry point to the cli app, takes care of passing arguments and error handling
229+ // RunAndExitOnError calls .Run() and exits non-zero if an error was returned
230+ //
231+ // Deprecated: instead you should return an error that fulfills cli.ExitCoder
232+ // to cli.App.Run. This will cause the application to exit with the given eror
233+ // code in the cli.ExitCoder
230234func (a * App ) RunAndExitOnError () {
231- fmt .Fprintf (os .Stderr ,
232- "DEPRECATED cli.App.RunAndExitOnError. %s See %s\n " ,
233- contactSysadmin , runAndExitOnErrorDeprecationURL )
234235 if err := a .Run (os .Args ); err != nil {
235236 fmt .Fprintln (os .Stderr , err )
236237 OsExiter (1 )
@@ -422,9 +423,6 @@ func HandleAction(action interface{}, context *Context) (err error) {
422423 vals := reflect .ValueOf (action ).Call ([]reflect.Value {reflect .ValueOf (context )})
423424
424425 if len (vals ) == 0 {
425- fmt .Fprintf (os .Stderr ,
426- "DEPRECATED Action signature. Must be `cli.ActionFunc`. %s See %s\n " ,
427- contactSysadmin , appActionDeprecationURL )
428426 return nil
429427 }
430428
0 commit comments