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