forked from toolshed/abra
refactor(cli): moved commands and cli out of main
This commit is contained in:
39
cli/cli.go
Normal file
39
cli/cli.go
Normal file
@ -0,0 +1,39 @@
|
||||
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",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
err := app.Run(os.Args)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user