From 74af85a00da15038fa915e6be00fb0679c113376 Mon Sep 17 00:00:00 2001 From: knqyf263 Date: Tue, 8 Sep 2020 17:53:16 +0300 Subject: [PATCH] feat(help): add ShowSubcommandHelpAndExit --- help.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/help.go b/help.go index c1e974a481..7f33a23645 100644 --- a/help.go +++ b/help.go @@ -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 {