-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathcommands.go
56 lines (46 loc) · 813 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package radigo
import (
"os"
"github.com/mitchellh/cli"
)
var Ui cli.Ui
const (
infoPrefix = "INFO: "
warnPrefix = "WARN: "
errorPrefix = "ERROR: "
)
func init() {
Ui = &cli.PrefixedUi{
InfoPrefix: infoPrefix,
WarnPrefix: warnPrefix,
ErrorPrefix: errorPrefix,
Ui: &cli.BasicUi{
Writer: os.Stdout,
},
}
}
func AreaCommandFactory() (cli.Command, error) {
return &areaCommand{
ui: Ui,
}, nil
}
func RecCommandFactory() (cli.Command, error) {
return &recCommand{
ui: Ui,
}, nil
}
func RecLiveCommandFactory() (cli.Command, error) {
return &recLiveCommand{
ui: Ui,
}, nil
}
func BrowseCommandFactory() (cli.Command, error) {
return &browseCommand{
ui: Ui,
}, nil
}
func BrowseLiveCommandFactory() (cli.Command, error) {
return &browseLiveCommand{
ui: Ui,
}, nil
}