forked from skx/rss2email
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
53 lines (45 loc) · 958 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
48
49
50
51
52
53
//
// Entry-point for our application.
//
package main
import (
"fmt"
"os"
"github.com/skx/subcommands"
)
//
// Recovery is good
//
func recoverPanic() {
if r := recover(); r != nil {
fmt.Printf("recovered from panic while running %v\n%s\n", os.Args, r)
}
}
//
// Register the subcommands, and run the one the user chose.
//
func main() {
//
// Catch errors
//
defer recoverPanic()
//
// Register each of our subcommands.
//
subcommands.Register(&addCmd{})
subcommands.Register(&cronCmd{})
subcommands.Register(&configCmd{})
subcommands.Register(&daemonCmd{})
subcommands.Register(&delCmd{})
subcommands.Register(&exportCmd{})
subcommands.Register(&importCmd{})
subcommands.Register(&listCmd{})
subcommands.Register(&listDefaultTemplateCmd{})
subcommands.Register(&seenCmd{})
subcommands.Register(&unseeCmd{})
subcommands.Register(&versionCmd{})
//
// Execute the one the user chose.
//
os.Exit(subcommands.Execute())
}