-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
main.go
39 lines (33 loc) · 793 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
//
// Entry-point to the puppet-summary service.
//
package main
import (
"context"
"flag"
"fmt"
"os"
"runtime/debug"
"github.com/google/subcommands"
)
//
// Setup our sub-commands and use them.
//
func main() {
defer func() {
if r := recover(); r != nil {
fmt.Println("Panic at the disco: \n" + string(debug.Stack()))
}
}()
subcommands.Register(subcommands.HelpCommand(), "")
subcommands.Register(subcommands.FlagsCommand(), "")
subcommands.Register(subcommands.CommandsCommand(), "")
subcommands.Register(&metricsCmd{}, "")
subcommands.Register(&pruneCmd{}, "")
subcommands.Register(&serveCmd{}, "")
subcommands.Register(&versionCmd{}, "")
subcommands.Register(&yamlCmd{}, "")
flag.Parse()
ctx := context.Background()
os.Exit(int(subcommands.Execute(ctx)))
}