2021-07-15 02:44:07 +00:00
|
|
|
package cli
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
|
2021-08-02 01:10:41 +00:00
|
|
|
"coopcloud.tech/abra/cli/app"
|
|
|
|
"coopcloud.tech/abra/cli/internal"
|
|
|
|
"coopcloud.tech/abra/cli/recipe"
|
|
|
|
"coopcloud.tech/abra/cli/server"
|
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{
|
2021-07-26 21:58:34 +00:00
|
|
|
Name: "abra",
|
|
|
|
Usage: `The Co-op Cloud command-line utility belt 🎩🐇
|
|
|
|
|
|
|
|
____ ____ _ _
|
|
|
|
/ ___|___ ___ _ __ / ___| | ___ _ _ __| |
|
|
|
|
| | / _ \ _____ / _ \| '_ \ | | | |/ _ \| | | |/ _' |
|
|
|
|
| |__| (_) |_____| (_) | |_) | | |___| | (_) | |_| | (_| |
|
|
|
|
\____\___/ \___/| .__/ \____|_|\___/ \__,_|\__,_|
|
|
|
|
|_|
|
|
|
|
`,
|
2021-07-15 02:44:07 +00:00
|
|
|
Version: fmt.Sprintf("%s-%s", version, commit[:7]),
|
|
|
|
Commands: []*cli.Command{
|
2021-08-02 01:10:41 +00:00
|
|
|
app.AppCommand,
|
|
|
|
server.ServerCommand,
|
|
|
|
recipe.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{
|
2021-08-02 01:10:41 +00:00
|
|
|
internal.EnvFlag,
|
|
|
|
internal.StackFlag,
|
|
|
|
internal.SkipCheckFlag,
|
|
|
|
internal.SkipUpdateFlag,
|
|
|
|
internal.VerboseFlag,
|
|
|
|
internal.BranchFlag,
|
|
|
|
internal.NoPromptFlag,
|
|
|
|
internal.DebugFlag,
|
|
|
|
internal.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
|
|
|
}
|
|
|
|
}
|