2021-07-15 02:44:07 +00:00
|
|
|
package cli
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
|
2021-07-21 08:04:34 +00:00
|
|
|
"github.com/sirupsen/logrus"
|
2021-07-15 02:44:07 +00:00
|
|
|
"github.com/urfave/cli/v2"
|
|
|
|
)
|
|
|
|
|
2021-07-21 11:32:16 +00:00
|
|
|
func RunApp(version, commit string) {
|
2021-07-15 02:44:07 +00:00
|
|
|
app := &cli.App{
|
|
|
|
Name: "abra",
|
2021-07-20 22:19:06 +00:00
|
|
|
Usage: "The Co-op Cloud utility belt 🎩🐇",
|
2021-07-15 02:44:07 +00:00
|
|
|
Version: fmt.Sprintf("%s-%s", version, commit[:7]),
|
|
|
|
Commands: []*cli.Command{
|
|
|
|
AppCommand,
|
|
|
|
ServerCommand,
|
2021-07-21 08:58:13 +00:00
|
|
|
RecipeCommand,
|
2021-07-20 21:59:47 +00:00
|
|
|
VersionCommand,
|
2021-07-15 02:44:07 +00:00
|
|
|
},
|
2021-07-17 04:11:48 +00:00
|
|
|
Flags: []cli.Flag{
|
|
|
|
EnvFlag,
|
|
|
|
StackFlag,
|
|
|
|
SkipCheckFlag,
|
|
|
|
SkipUpdateFlag,
|
|
|
|
VerboseFlag,
|
|
|
|
BranchFlag,
|
|
|
|
NoPromptFlag,
|
|
|
|
DebugFlag,
|
2021-07-17 08:29:25 +00:00
|
|
|
ContextFlag,
|
2021-07-17 04:11:48 +00:00
|
|
|
},
|
2021-07-15 02:44:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
err := app.Run(os.Args)
|
|
|
|
if err != nil {
|
2021-07-21 08:04:34 +00:00
|
|
|
logrus.Fatal(err)
|
2021-07-15 02:44:07 +00:00
|
|
|
}
|
|
|
|
}
|