-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
49 lines (40 loc) · 881 Bytes
/
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
package main
import (
"fmt"
"os"
"github.com/codegangsta/cli"
"github.com/dockpit/pit/command"
)
type Command interface {
Name() string
Description() string
Usage() string
Run(c *cli.Context) error
Action() func(ctx *cli.Context)
Flags() []cli.Flag
}
var Version = "0.0.0"
var Build = "gobuild"
func main() {
app := cli.NewApp()
app.Author = "Ad van der Veer"
app.Email = "ad@dockpit.io"
app.Name = "pit"
app.Usage = "develop your (micro)service in isolation"
app.Version = fmt.Sprintf("%s (%s)", Version, Build)
cmds := []Command{
command.NewStart(Version),
command.NewClean(),
command.NewLocate(),
}
for _, c := range cmds {
app.Commands = append(app.Commands, cli.Command{
Name: c.Name(),
Usage: c.Usage(),
Action: c.Action(),
Description: c.Description(),
Flags: c.Flags(),
})
}
app.Run(os.Args)
}