Skip to content

Commit

Permalink
Merge pull request #1183 from knqyf263/feat/subcommand_help_and_exit
Browse files Browse the repository at this point in the history
feat(help): add ShowSubcommandHelpAndExit
  • Loading branch information
rliebz committed Oct 31, 2020
2 parents 3629eb8 + 74af85a commit d89733e
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 d89733e

Please sign in to comment.