-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
45 lines (36 loc) · 691 Bytes
/
main.go
File metadata and controls
45 lines (36 loc) · 691 Bytes
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
package main
import (
"fmt"
"log"
"os"
)
func main() {
if len(os.Args) > 1 {
switch os.Args[1] {
case "gen":
gen()
case "gen-rm":
genRM()
case "clean":
buildClean()
case "version":
fmt.Println("version:", version)
os.Exit(0)
default:
fmt.Println("usage: ", os.Args[0], "[COMMAND], no COMMAND builds it")
fmt.Println("COMMAND is one of")
fmt.Println("\tgen - generate config files")
fmt.Println("\tgen-rm - remove generated config files")
fmt.Println("\tclean - clean the build")
fmt.Println("\tversion - print tool version")
os.Exit(1)
}
return
}
build()
}
func exitIfErr(err error) {
if err != nil {
log.Fatal(err)
}
}