abra/cli/cli.go
Roxie Gibson 6c748922b4
feat: added context flag to make dev easier
needed until we have proper server subcommand system
2021-07-17 09:29:25 +01:00

51 lines
730 B
Go

package cli
import (
"fmt"
"log"
"os"
"github.com/urfave/cli/v2"
)
func RunApp(version, commit string) {
app := &cli.App{
Name: "abra",
Usage: "The cooperative 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",
},
},
},
},
Flags: []cli.Flag{
EnvFlag,
StackFlag,
SkipCheckFlag,
SkipUpdateFlag,
VerboseFlag,
BranchFlag,
NoPromptFlag,
DebugFlag,
ContextFlag,
},
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}