/
main.go
74 lines (64 loc) · 1.25 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
package main
import (
"log"
"os"
"sort"
"github.com/urfave/cli"
)
var (
appName, appVer string
)
func main() {
app := cli.NewApp()
app.Name = appName
app.HelpName = appName
app.Usage = "CLI tools which used to visualize Akamai Network list usage."
app.Version = appVer
app.Copyright = ""
app.Authors = []cli.Author{
{
Name: "Petr Artamonov",
},
{
Name: "Rafal Pieniazek",
},
}
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "output, o",
Value: "json",
Usage: "Output result as .json metadata or as .dot graphviz files",
},
cli.StringFlag{
Name: "map-file, m",
Value: "",
Usage: "Path for `configuration map file`",
},
cli.StringFlag{
Name: "id, i",
Value: "",
Usage: "Network List `ID`",
},
cli.StringFlag{
Name: "name, n",
Value: "",
Usage: "Network List `NAME`",
},
cli.StringFlag{
Name: "destination, d",
Value: "",
Usage: "Path for destination files. If empty results will be sent to STDOUT",
},
cli.StringFlag{
Name: "source, s",
Value: os.TempDir(),
Usage: "Path, where Security configuration JSON files are located",
},
}
sort.Sort(cli.FlagsByName(app.Flags))
app.Action = cmdSearch
err := app.Run(os.Args)
if err != nil {
log.Println(err)
}
}