abra/cli/errors.go
Roxie Gibson ffd1b3a771
refactor: function rename
`errorExit` renamed to `showSubcommandHelpAndError`
2021-08-02 01:08:17 +01:00

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)
}