Merge pull request #1183 from knqyf263/feat/subcommand_help_and_exit

feat(help): add ShowSubcommandHelpAndExit
main
Robert Liebowitz 4 years ago committed by GitHub
commit d89733ea65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -214,6 +214,12 @@ func ShowCommandHelp(ctx *Context, command string) error {
return nil 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 // ShowSubcommandHelp prints help for the given subcommand
func ShowSubcommandHelp(c *Context) error { func ShowSubcommandHelp(c *Context) error {
if c == nil { if c == nil {

Loading…
Cancel
Save