-
Notifications
You must be signed in to change notification settings - Fork 13
/
commands.go
42 lines (36 loc) · 800 Bytes
/
commands.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
package main
import (
"os"
"github.com/lewispeckover/consulator/command"
"github.com/mitchellh/cli"
)
// Commands is the mapping of all the available Serf commands.
var Commands map[string]cli.CommandFactory
func init() {
ui := &cli.BasicUi{Writer: os.Stdout}
Commands = map[string]cli.CommandFactory{
"dump": func() (cli.Command, error) {
return &command.DumpCommand{
Ui: ui,
}, nil
},
"import": func() (cli.Command, error) {
return &command.ImportCommand{
Ui: ui,
}, nil
},
"sync": func() (cli.Command, error) {
return &command.ImportCommand{
Ui: ui,
Purge: true,
}, nil
},
"version": func() (cli.Command, error) {
return &command.VersionCommand{
Version: Version,
BuildDate: BuildDate,
Ui: ui,
}, nil
},
}
}