-
Notifications
You must be signed in to change notification settings - Fork 414
/
main.go
52 lines (40 loc) · 645 Bytes
/
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
package main
import (
"flag"
"fmt"
"github.com/davyxu/golog"
"github.com/davyxu/tabtoy/build"
"github.com/pkg/profile"
"os"
)
var log = golog.New("main")
var enableProfile = false
func main() {
flag.Parse()
// 版本
if *paramVersion {
build.Print()
return
}
switch *paramMode {
case "v3":
type stopper interface {
Stop()
}
var s stopper
if enableProfile {
s = profile.Start(profile.CPUProfile, profile.ProfilePath("."))
}
V3Entry()
if s != nil {
s.Stop()
}
case "exportorv2", "v2":
V2Entry()
case "v2tov3":
V2ToV3Entry()
default:
fmt.Println("--mode not specify")
os.Exit(1)
}
}