-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
47 lines (41 loc) · 820 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
package main
import (
"os"
"runtime"
)
var (
shadeRepo = "https://github.com/shade-linux/buildscripts/"
shadeDir = "/usr/local/shade/" // explicit `/` at the end is crucial
)
func main() {
if !(runtime.GOOS == "darwin" || runtime.GOOS == "linux") {
err("Shade supports only linux and macOSX")
os.Exit(1)
}
if len(os.Args) < 2 {
help()
}
subcommand := os.Args[1]
switch subcommand {
case "help":
help()
case "setup":
setup()
case "install":
packages := os.Args[2:]
install(packages)
case "uninstall":
packages := os.Args[2:]
uninstall(packages)
case "upgrade":
packages := os.Args[2:]
upgrade(packages)
case "update":
update()
case "query":
query(os.Args[2])
default:
err("Unknown command:", subcommand)
os.Exit(1)
}
}