forked from vim-volt/volt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
47 lines (43 loc) · 887 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
package main
import (
"os"
"github.com/vim-volt/volt/cmd"
"github.com/vim-volt/volt/logger"
)
func main() {
os.Exit(Main())
}
func Main() int {
if len(os.Args) <= 1 {
os.Args = append(os.Args, "help")
}
switch os.Args[1] {
case "get":
return cmd.Get(os.Args[2:])
case "rm":
return cmd.Rm(os.Args[2:])
case "add":
return cmd.Add(os.Args[2:])
case "query":
return cmd.Query(os.Args[2:])
case "enable":
return cmd.Enable(os.Args[2:])
case "disable":
return cmd.Disable(os.Args[2:])
case "list":
return cmd.List(os.Args[2:])
case "profile":
return cmd.Profile(os.Args[2:])
case "plugconf":
return cmd.Plugconf(os.Args[2:])
case "rebuild":
return cmd.Rebuild(os.Args[2:])
case "version":
return cmd.Version(os.Args[2:])
case "help":
return cmd.Help(os.Args[2:])
default:
logger.Error("Unknown command '" + os.Args[1] + "'")
return 3
}
}