refactor: break up cli pkg into nice small chunks
This commit is contained in:
15
cli/internal/errors.go
Normal file
15
cli/internal/errors.go
Normal file
@ -0,0 +1,15 @@
|
||||
package internal
|
||||
|
||||
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)
|
||||
}
|
Reference in New Issue
Block a user