-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
60 lines (55 loc) · 1.27 KB
/
main.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
package main
import (
"os"
"github.com/makii42/gottaw/config"
"github.com/makii42/gottaw/defaults"
"github.com/makii42/gottaw/output"
"github.com/makii42/gottaw/watch"
"gopkg.in/urfave/cli.v1"
)
func main() {
app := cli.NewApp()
app.Name = "gotta watch"
app.Usage = "Run command(s) when files in the folder change."
app.EnableBashCompletion = true
app.Action = watch.WatchCmd.Action
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "f, folder",
Value: ".",
Usage: "Folder to watch for changes",
EnvVar: "GOTTAW_FOLDER",
},
cli.StringFlag{
Name: "c, config",
Value: "./.gottaw.yml",
Usage: "Config file to read",
Destination: &config.File,
},
cli.StringFlag{
Name: "d, delay",
Value: "1500ms",
Usage: "Delay of the pipeline action after event",
},
cli.BoolFlag{
Name: "t, trace",
Usage: "Log more details",
Destination: &output.Trace,
},
cli.BoolFlag{
Name: "q, quiet",
Usage: "Logs nothing but pass-through output and success messages",
Destination: &output.Quiet,
},
cli.BoolFlag{
Name: "g, growl",
Usage: "Notify OS via growl about pipeline result",
},
}
app.Commands = []cli.Command{
watch.WatchCmd,
watch.OneRunCmd,
defaults.DefaultsCmd,
}
app.Run(os.Args)
}