-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
main.go
71 lines (63 loc) · 1.9 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package main
import (
"fmt"
"os"
"github.com/skx/subcommands"
)
// Recovery is good
func recoverPanic() {
if os.Getenv("DEBUG") != "" {
return
}
if r := recover(); r != nil {
fmt.Printf("recovered from panic while running %v\n%s\n", os.Args, r)
fmt.Printf("To see the panic run 'export DEBUG=on' and repeat.\n")
}
}
// Register the subcommands, and run the one the user chose.
func main() {
//
// Catch errors
//
defer recoverPanic()
//
// Register each of our subcommands.
//
subcommands.Register(&SSLExpiryCommand{})
subcommands.Register(&calcCommand{})
subcommands.Register(&chooseFileCommand{})
subcommands.Register(&chooseSTDINCommand{})
subcommands.Register(&chronicCommand{})
subcommands.Register(&collapseCommand{})
subcommands.Register(&commentsCommand{})
subcommands.Register(&cppCommand{})
subcommands.Register(&envTemplateCommand{})
subcommands.Register(&execSTDINCommand{})
subcommands.Register(&expectCommand{})
subcommands.Register(&feedsCommand{})
subcommands.Register(&findCommand{})
subcommands.Register(&fingerdCommand{})
subcommands.Register(&html2TextCommand{})
subcommands.Register(&httpGetCommand{})
subcommands.Register(&httpdCommand{})
subcommands.Register(&ipsCommand{})
subcommands.Register(&markdownTOCCommand{})
subcommands.Register(&passwordCommand{})
subcommands.Register(&rssCommand{})
subcommands.Register(&runDirectoryCommand{})
subcommands.Register(&splayCommand{})
subcommands.Register(&timeoutCommand{})
subcommands.Register(&todoCommand{})
subcommands.Register(&treeCommand{})
subcommands.Register(&urlsCommand{})
subcommands.Register(&validateJSONCommand{})
subcommands.Register(&validateXMLCommand{})
subcommands.Register(&validateYAMLCommand{})
subcommands.Register(&versionCommand{})
subcommands.Register(&watchCommand{})
subcommands.Register(&withLockCommand{})
//
// Execute the one the user chose.
//
os.Exit(subcommands.Execute())
}