-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflag.go
55 lines (47 loc) · 953 Bytes
/
flag.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
51
52
53
54
55
package main
import (
"time"
"github.com/urfave/cli"
)
const (
dayTimeFormat = "2006-01-02"
)
var commonFlag = []cli.Flag{
cli.StringFlag{
Name: "project, p",
Value: "default",
Usage: "project name",
},
cli.StringFlag{
Name: "workflow, w",
Usage: "workflow name",
},
cli.StringFlag{
Name: "session, s",
Value: time.Now().Format(dayTimeFormat),
Usage: "set session_time to this time",
},
}
var pollingFlag = []cli.Flag{
cli.IntFlag{
Name: "max-waittime",
Usage: "wating time(sec)",
Value: 3600,
},
cli.IntFlag{
Name: "interval",
Usage: "polling interval(sec)",
Value: 60,
},
}
// TODO: add retry attempt name
var retryFlag = []cli.Flag{
cli.BoolTFlag{
Name: "retry, r",
Usage: "retry attempts",
},
}
// pollingStatusFlag for polling status
var pollingStatusFlag = append(commonFlag, pollingFlag...)
// retryAttemptFlag for retry command
var retryAttemptFlag = append(commonFlag, retryFlag...)