abra/cli/cli.go

52 lines
750 B
Go
Raw Normal View History

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) {
app := &cli.App{
Name: "abra",
Usage: "The Co-op Cloud utility belt 🎩🐇",
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,
},
Flags: []cli.Flag{
EnvFlag,
StackFlag,
SkipCheckFlag,
SkipUpdateFlag,
VerboseFlag,
BranchFlag,
NoPromptFlag,
DebugFlag,
ContextFlag,
},
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}