-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmd.go
46 lines (32 loc) · 760 Bytes
/
cmd.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
package main
import (
"flag"
"fmt"
"github.com/tartavull/govisual/server"
)
const message = `Graphs the dependencies between Go packages.
Usage
$GOPATH/bin/govisual
The program presents a web interface on port 8080(default).
The various visualisations are registred as top level handlers. Here are some examples
http://localhost:8080/tree/io
http://localhost:8080/radial/math/rand
http://localhost:8080/forcegraph/fmt
http://localhost:8080/chord/cmd/go
govisual works sort of like godoc.
flags:
`
func main() {
port := flag.Int("port", 8080, "Port number")
run := true
flag.Usage = func() {
fmt.Printf(message)
flag.PrintDefaults()
run = false
return
}
flag.Parse()
if run {
server.Serve(*port)
}
}