Skip to content

Commit

Permalink
feat(help): add ShowSubcommandHelpAndExit
Browse files Browse the repository at this point in the history
  • Loading branch information
knqyf263 committed Sep 8, 2020
1 parent d2d2098 commit 74af85a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions help.go
Expand Up @@ -214,6 +214,12 @@ func ShowCommandHelp(ctx *Context, command string) error {
return nil
}

// ShowSubcommandHelpAndExit - Prints help for the given subcommand and exits with exit code.
func ShowSubcommandHelpAndExit(c *Context, exitCode int) {
_ = ShowSubcommandHelp(c)
os.Exit(exitCode)
}

// ShowSubcommandHelp prints help for the given subcommand
func ShowSubcommandHelp(c *Context) error {
if c == nil {
Expand Down

0 comments on commit 74af85a

Please sign in to comment.