-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
43 lines (39 loc) · 791 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
package main
import (
"fmt"
"os"
)
func main() {
// Print the command line arguments
fmt.Println(os.Args)
// Print the number of command line arguments
fmt.Println(len(os.Args))
// Set configuration
configure()
switch command := os.Args[1]; command {
case "convert":
if len(os.Args) != 4 {
fmt.Println("Usage: www-graph convert <source-dir> <dest-dir>")
os.Exit(1)
}
html2md(os.Args[2], os.Args[3])
case "check":
if len(os.Args) != 2 {
fmt.Println("Usage: www-graph check")
os.Exit(1)
}
check()
case "export":
if len(os.Args) != 3 {
fmt.Println("Usage: www-graph export <source-dir>")
os.Exit(1)
}
export(os.Args[2])
case "clear":
if len(os.Args) != 2 {
fmt.Println("Usage: www-graph clear")
os.Exit(1)
}
clearDatabase()
}
}