-
Notifications
You must be signed in to change notification settings - Fork 0
/
baduk.go
52 lines (38 loc) · 1.05 KB
/
baduk.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
package main
import (
"fmt"
"os"
"github.com/bunniesandbeatings/go-flavor-parser/baduk/commands"
"github.com/jawher/mow.cli"
)
func main() {
doc := `Intermediate Golang AST for Architectural Viz
Copyright (c) 2014 Rasheed Abdul-Aziz
License: MIT
Authors: Rasheed Abdul-Aziz, Glyn Normington`
parse := cli.App("baduk", doc)
gopath := parse.String(cli.StringOpt{
Name: "gopath",
Value: "",
Desc: "allows you to choose a different GOPATH to use during analysis",
EnvVar: "GOPATH",
})
goroot := parse.String(cli.StringOpt{
Name: "goroot",
Value: "",
Desc: "allows you to choose a different GOROOT to use during analysis",
EnvVar: "GOROOT",
})
packages := parse.StringArg("PACKAGES", "", "the package specification to parse")
parse.Spec = "[OPTIONS] PACKAGES"
parse.Version("v version", fmt.Sprintf("baduk %s", VERSION))
parse.Action = func() {
parseContext := &commands.ParseContext{
GOROOT: *goroot,
GOPATH: *gopath,
ImportSpec: *packages,
}
commands.ParsePackages(parseContext)
}
parse.Run(os.Args)
}