/
cli.go
50 lines (44 loc) · 893 Bytes
/
cli.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
49
50
package cmd
import (
"github.com/urfave/cli"
)
var app *cli.App
// ArgsMapping object mapping
type ArgsMapping struct {
EnvPath string
TemplatePath string
WorkerName string
WorkerConcurent string
UUID string
}
// Args Glabal Acces args command
var Args ArgsMapping
// Init Initialise a CLI app
func Init() *cli.App {
app = cli.NewApp()
app.Name = "duck"
app.Usage = "duck scheduler task send"
app.Author = "meong48"
app.Email = "meongbego@gmail.com"
app.Version = "0.0.1"
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "config, c",
Usage: "Load environtment config from `FILE`",
Destination: &Args.EnvPath,
},
}
return app
}
// AppCommands All Command line app
func AppCommands() *cli.App {
app := Init()
app.Commands = []cli.Command{
// createEnvi(),
worker(),
send(),
restServer(),
get(),
}
return app
}