-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
44 lines (37 loc) · 698 Bytes
/
main.go
File metadata and controls
44 lines (37 loc) · 698 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
package main
import (
"github.com/BSick7/envoy/command"
"github.com/mitchellh/cli"
"log"
"os"
)
var Version string
func main() {
c := cli.NewCLI("envoy", Version)
c.Args = os.Args[1:]
metaPtr := &command.Meta{
Ui: &cli.BasicUi{
Writer: os.Stdout,
ErrorWriter: os.Stderr,
},
Version: Version,
}
meta := *metaPtr
c.Commands = map[string]cli.CommandFactory{
"backup": func() (cli.Command, error) {
return &command.BackupCommand{
Meta: meta,
}, nil
},
"restore": func() (cli.Command, error) {
return &command.RestoreCommand{
Meta: meta,
}, nil
},
}
exitStatus, err := c.Run()
if err != nil {
log.Println(err)
}
os.Exit(exitStatus)
}