-
Notifications
You must be signed in to change notification settings - Fork 31
/
flags.go
140 lines (124 loc) · 3.56 KB
/
flags.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
package main
import (
"github.com/urfave/cli"
)
// getFlagBuildOutput provisions --output
func getFlagBuildOutput() cli.Flag {
return cli.StringFlag{
Name: "output, o",
Usage: "| where <value> is the relative path to the binary",
Value: DefaultBuildOutput,
}
}
// getFlagCommandArguments provisions --output
func getFlagCommandArguments() cli.Flag {
return cli.StringFlag{
Name: "args",
Usage: "| where <value> is a comma delimited string containing arguments to pass to commands in the final execution group",
Value: DefaultCommandArguments,
}
}
// getFlagCommandsDelimiter provisions --exec-delim
func getFlagCommandsDelimiter() cli.Flag {
return cli.StringFlag{
Name: "exec-delim",
Usage: "| where <value> is the delimiter for commands in an execution group",
Value: DefaultCommandsDelimiter,
}
}
// getFlagEnvVars provisions --env
func getFlagEnvVars() cli.Flag {
return cli.StringSliceFlag{
Name: "env, e",
Usage: "| where <value> is the relative path to the binary - specify multiple of these to pass in multiple environment variables",
}
}
// getFlagExecGroups provisions --exec
func getFlagExecGroups() cli.Flag {
return cli.StringSliceFlag{
Name: "exec",
Usage: "| where <value> is a comma-delimited set of commands to run in parallel - specify multiple of these to define multiple execution groups",
}
}
// getFlagFileExtensions provisions --ext
func getFlagFileExtensions() cli.Flag {
return cli.StringFlag{
Name: "exts",
Usage: "| where <value> is a comma-delimited set of file extensions without the period (.)",
Value: DefaultFileExtensions,
}
}
// getFlagIgnoredNames provisions --ignore
func getFlagIgnoredNames() cli.Flag {
return cli.StringFlag{
Name: "ignore",
Usage: "| where <value> is a comma-delimited set of file/directory names to not watch",
Value: DefaultIgnoredNames,
}
}
// getFlagRate provisions --rate
func getFlagRate() cli.Flag {
return cli.DurationFlag{
Name: "rate",
Usage: "| where <value> is a duration",
Value: DefaultRefreshRate,
}
}
// etFlagWatchDirectory provisions --watch
func getFlagWatchDirectory() cli.Flag {
return cli.StringFlag{
EnvVar: "watch",
Name: "watch",
Usage: "| where <value> is an absolute path to a directory to watch",
Value: getCurrentWorkingDirectory(),
}
}
// getFlagWorkDirectory provisions --dir
func getFlagWorkDirectory() cli.Flag {
return cli.StringFlag{
EnvVar: "DIR",
Name: "dir",
Usage: "| where <value> is an absolute path to a directory to use as the current working directory",
Value: getCurrentWorkingDirectory(),
}
}
// getFlagCommit provisions --commit
func getFlagCommit() cli.Flag {
return cli.BoolFlag{
EnvVar: "COMMIT",
Name: "commit",
Usage: "| set the display to only the commit hash",
}
}
// getFlagSemver provisions --semver
func getFlagSemver() cli.Flag {
return cli.BoolFlag{
EnvVar: "SEMVER",
Name: "semver",
Usage: "| set the display to only the semver version",
}
}
// getFlagSilent provisions --silent
func getFlagSilent() cli.Flag {
return cli.BoolFlag{
EnvVar: "SILENT",
Name: "silent, s",
Usage: "| silence the logs",
}
}
// getFlagVerboseLogs provisions --verbose
func getFlagVerboseLogs() cli.Flag {
return cli.BoolFlag{
EnvVar: "VERBOSE",
Name: "verbose, vv",
Usage: "| print verbose (debug level) logs (use for debugging)",
}
}
// getFlagSuperVerboseLogs provisions --vverbose
func getFlagSuperVerboseLogs() cli.Flag {
return cli.BoolFlag{
EnvVar: "VVERBOSE",
Name: "vverbose, vvv",
Usage: "| print very verbose (trace level) logs (use for development of godev itself)",
}
}