-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
76 lines (71 loc) · 1.38 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package main
import (
"os"
"github.com/codegangsta/cli"
)
func main() {
app := cli.NewApp()
app.Name = "gosub"
app.Usage = "go dependency submodule automator"
app.Version = "0.0.1"
app.Commands = []cli.Command{
{
Name: "list",
ShortName: "e",
Usage: "list all packages required by the given packages",
Flags: []cli.Flag{
cli.StringSliceFlag{
Name: "app, a",
Value: &cli.StringSlice{},
},
cli.StringSliceFlag{
Name: "test, t",
Value: &cli.StringSlice{},
},
},
Action: list,
},
{
Name: "sync",
ShortName: "s",
Usage: "sync packages as submodules (git), or vendored (other)",
Flags: []cli.Flag{
cli.StringFlag{
Name: "repo, r",
Value: ".",
},
cli.StringFlag{
Name: "gopath, g",
Value: ".",
},
cli.StringSliceFlag{
Name: "ignore, i",
Value: &cli.StringSlice{},
Usage: "Submodule to ignore",
},
cli.BoolTFlag{
Name: "force-https",
Usage: "Rewrite ssh repositories as https. (default \"true\")",
},
},
Action: sync,
},
{
Name: "fix",
ShortName: "f",
Usage: "fix partially constructed submodules",
Flags: []cli.Flag{
cli.StringFlag{
Name: "repo, r",
Value: ".",
},
cli.StringFlag{
Name: "gopath, g",
Value: ".",
},
},
Action: fix,
},
}
app.Run(os.Args)
}