-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathcommands.go
48 lines (46 loc) · 851 Bytes
/
commands.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
47
48
package main
import (
"github.com/urfave/cli"
"os"
)
// 这个文件用来存储所有命令
func commands() []cli.Command {
return []cli.Command{
{
Name: "init",
Usage: "Init a bingo project.",
Action: func(c *cli.Context) error {
path, _ := os.Getwd()
initProject(path)
return nil
},
},
{
Name: "create",
Usage: "Create a New Project Directory.",
Flags: []cli.Flag{
cli.StringFlag{
Name: "projectName",
Value: "bingo_project",
Usage: "The new project name.",
},
},
Action: CreateProject,
},
{
Name: "run",
Usage: "Start a server",
Subcommands: []cli.Command{
{
Name: "dev",
Usage: "Start a development server. Listen the current directory.",
Action: Dev,
},
},
},
{
Name: "sword",
Subcommands: sword(),
},
}
}