|
|
@@ -3,7 +3,11 @@ package main |
|
|
|
import ( |
|
|
|
"fmt" |
|
|
|
"github.com/gookit/color" |
|
|
|
"github.com/urfave/cli/v2" |
|
|
|
"golib.gaore.com/GaoreGo/beegoinit-cmd/cmd" |
|
|
|
"log" |
|
|
|
"os" |
|
|
|
"time" |
|
|
|
) |
|
|
|
|
|
|
|
func main() { |
|
|
@@ -19,5 +23,30 @@ func main() { |
|
|
|
//red := color.Red.Render |
|
|
|
//fmt.Println("how o %s", red(time.Now().Format(time.ANSIC))) |
|
|
|
fmt.Println(logo) |
|
|
|
cmd.New() |
|
|
|
|
|
|
|
app := cli.App{ |
|
|
|
Name: "beegoinit-cmd", |
|
|
|
Usage: "Create a new project with beego init", |
|
|
|
Commands: []*cli.Command{ |
|
|
|
{ |
|
|
|
Name: "create", |
|
|
|
Aliases: []string{"c"}, |
|
|
|
Usage: "Create a new project with beego init", |
|
|
|
Action: cmd.New, |
|
|
|
}, |
|
|
|
{ |
|
|
|
Name: "date", |
|
|
|
Aliases: []string{"d"}, |
|
|
|
Usage: "Print date", |
|
|
|
Action: func(c *cli.Context) error { |
|
|
|
fmt.Println(time.Now().Format(time.RFC3339)) |
|
|
|
return nil |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
if err := app.Run(os.Args); err != nil { |
|
|
|
log.Fatal(err) |
|
|
|
} |
|
|
|
} |