-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands.go
73 lines (69 loc) · 1.49 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package commands
import "github.com/urfave/cli"
// AllCommands contains the commands for the CLI
var AllCommands []cli.Command
// GlobalFlags contains the flags allowed for each command
var GlobalFlags []cli.Flag
var (
buildNumFlag = cli.StringFlag{
Name: "num",
Value: "",
Usage: "build number",
}
branchFlag = cli.StringFlag{
Name: "branch, b",
Value: "",
Usage: "project branch name, default master",
EnvVar: "CIRCLECI_BRANCH",
}
envVarFlag = cli.StringFlag{
Name: "var",
Value: "",
Usage: "use VAR name for get and VAR=value for set",
}
filterFlag = cli.StringFlag{
Name: "filter, f",
Value: "",
Usage: "filter by status of build ie. successful, failed, running",
}
limitFlag = cli.StringFlag{
Name: "limit, l",
Value: "",
Usage: "limit of builds to return, default 100",
}
offsetFlag = cli.StringFlag{
Name: "offset, o",
Value: "",
Usage: "offset of builds to start from",
}
projectFlag = cli.StringFlag{
Name: "project, p",
Value: "",
Usage: "project name of repository",
EnvVar: "CIRCLECI_PROJECT",
}
tokenFlag = cli.StringFlag{
Name: "token, t",
Value: "",
Usage: "circle-token param for authentication",
EnvVar: "CIRCLECI_TOKEN",
}
userFlag = cli.StringFlag{
Name: "user, u",
Value: "",
Usage: "user or org",
EnvVar: "CIRCLECI_ORG,CIRCLECI_USER",
}
)
func init() {
AllCommands = []cli.Command{
BuildCmd,
BuildsCmd,
ClearCacheCmd,
EnvCmd,
RecentBuildsCmd,
}
GlobalFlags = []cli.Flag{
tokenFlag,
}
}