2021-07-15 02:44:07 +00:00
|
|
|
package cli
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"log"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/urfave/cli/v2"
|
|
|
|
)
|
|
|
|
|
2021-07-20 22:17:16 +00:00
|
|
|
func RunApp(version string, 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,
|
|
|
|
{
|
|
|
|
|
|
|
|
Name: "recipe",
|
|
|
|
HideHelp: true,
|
|
|
|
Subcommands: []*cli.Command{
|
|
|
|
{
|
|
|
|
Name: "list",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "create",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
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 {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|