Skip to content
Myr

RunE commands should be considered runnable.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Alexander Guy · committed by Alexander Guy · parent 1f92281 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:command.go+2 added-2 removed
466 unmodified lines
467 if err != nil {468 return err469 }470 // If help is called, regardless of other flags, return we want help471 // Also say we need help if c.Run is nil.471 // Also say we need help if the command isn't runnable.472 helpVal, err := c.Flags().GetBool("help")473 if err != nil {474 // should be impossible to get here as we always declare a help475 // flag in initHelpFlag()
366 unmodified lines
842}843844// Determine if the command is itself runnable845func (c *Command) Runnable() bool {846 return c.Run != nil846 return c.Run != nil || c.RunE != nil847}848849// Determine if the command has children commands850func (c *Command) HasSubCommands() bool {
229 unmodified lines