-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
46 lines (40 loc) · 855 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
"fmt"
"log"
"os"
"github.com/joho/godotenv"
"github.com/starfork/gostar/generator"
"github.com/urfave/cli/v2"
_ "github.com/go-sql-driver/mysql"
)
func main() {
godotenv.Load(".env.development")
app := &cli.App{
Name: "gostar",
Usage: "stargo tools collection",
Commands: []*cli.Command{
{
Name: "new",
Usage: "create project files",
Flags: generator.Flags,
Aliases: []string{"gen"},
Before: generator.Before,
Action: generator.Action,
Subcommands: generator.Subcommands(),
},
{
Name: "other",
Usage: "other funcs to be implement",
Action: func(ctx *cli.Context) error {
fmt.Println("to be implement")
return nil
},
},
},
}
app.Suggest = true
if err := app.Run(os.Args); err != nil {
log.Fatal(err)
}
}