wujian_develop_tool/main.go

57 lines
963 B
Go
Raw Normal View History

2022-01-05 20:25:29 +08:00
package main
import (
"log"
"os"
"github.com/urfave/cli/v2"
)
func main() {
2022-01-06 00:19:22 +08:00
flags := []cli.Flag{
&cli.BoolFlag{
Name: "all",
Aliases: []string{"a"},
Usage: "所有应用",
},
&cli.StringSliceFlag{
Name: "app",
Usage: "app列表",
},
&cli.StringFlag{
Name: "config",
Aliases: []string{"c"},
Usage: "配置文件",
},
}
2022-01-05 20:25:29 +08:00
app := cli.NewApp()
app = &cli.App{
Name: "wujian develop tool",
Usage: "无间开发者工具箱",
Version: "v0.0.1",
EnableBashCompletion: true,
2022-01-06 00:19:22 +08:00
Flags: flags,
2022-01-05 20:25:29 +08:00
Commands: cli.Commands{
&cli.Command{
Name: "api",
Usage: "api应用列表",
Action: ActionApi,
2022-01-06 00:19:22 +08:00
Flags: flags,
Subcommands: []*cli.Command{
{
Name: "new",
Usage: "创建一个api应用",
Action: ActionNewApi,
2022-01-05 20:25:29 +08:00
},
},
},
},
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}