16 lines
335 B
Go
16 lines
335 B
Go
package cli
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
// showSubcommandHelpAndError exits the program on error, logs the error to the terminal, and shows the help command.
|
|
func showSubcommandHelpAndError(c *cli.Context, err interface{}) {
|
|
cli.ShowSubcommandHelp(c)
|
|
logrus.Error(err)
|
|
os.Exit(1)
|
|
}
|