-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
60 lines (49 loc) · 1.04 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"
"time"
"github.com/pagient/pagient-cli/internal/config"
"github.com/pagient/pagient-cli/internal/version"
"gopkg.in/urfave/cli.v2"
)
func main() {
app := &cli.App{
Name: "pagient",
Version: version.Version.String(),
Usage: "pagient watcher",
Compiled: time.Now(),
Authors: []*cli.Author{
{
Name: "David Schneiderbauer",
Email: "david.schneiderbauer@dschneiderbauer.me",
},
},
Flags: []cli.Flag{
&cli.StringFlag{
Name: "config",
Value: "/conf/app.ini",
Usage: "set config path",
Destination: &config.Path,
},
},
Before: func(c *cli.Context) error {
return nil
},
Commands: []*cli.Command{
Watcher(),
},
}
cli.HelpFlag = &cli.BoolFlag{
Name: "help",
Aliases: []string{"h"},
Usage: "show the help, so what you see now",
}
cli.VersionFlag = &cli.BoolFlag{
Name: "version",
Aliases: []string{"v"},
Usage: "print the current version of that tool",
}
if err := app.Run(os.Args); err != nil {
os.Exit(1)
}
}