refactor: break up cli pkg into nice small chunks

This commit is contained in:
2021-08-02 02:10:41 +01:00
parent c2f53e493e
commit 30d11f48a7
29 changed files with 787 additions and 649 deletions

15
cli/internal/errors.go Normal file
View 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)
}