-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheffe-tool.go
60 lines (54 loc) · 1.25 KB
/
effe-tool.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 (
"github.com/codegangsta/cli"
"github.com/siscia/effe-tool/builder"
"github.com/siscia/effe-tool/docker"
"github.com/siscia/effe-tool/factory"
"math/rand"
"os"
"time"
)
func main() {
rand.Seed(time.Now().UnixNano())
app := cli.NewApp()
app.Name = "effe-tool"
app.Usage = "Utility to create, build and use effes."
app.Version = "0.2.3"
app.Commands = []cli.Command{
{
Name: "new",
Aliases: []string{"n"},
Usage: "Create a new empty effe.",
Action: factory.CreateNewEffe,
},
{
Name: "compile",
Aliases: []string{"c"},
Usage: "Compile a single file or a whole directory passed as argument.",
Flags: []cli.Flag{
cli.StringFlag{
Name: "dirout",
Value: "out/",
Usage: "Directory where to save the executables.",
},
cli.StringFlag{
Name: "out",
Value: "",
Usage: "Custom name to save your executable.",
},
cli.BoolFlag{
Name: "cgo",
Usage: "Set to true to enable cgo.",
},
},
Action: builder.Compile,
},
{
Name: "docker",
Aliases: []string{"d"},
Usage: "Create docker images of a single executable or of every executable in the directory passed as argument.",
Action: docker.Dockerify,
},
}
app.Run(os.Args)
}