core/commands2: Removed test subcommands
Matt Bell committed
Nov 7, 2014 at 23:23 UTC
bb7d4683f14f7880d88af4bd29d8dd553a9aa467
1 file changed
-52
core/commands2/root.go
-52
@@ -70,58 +70,6 @@ var rootSubcommands = map[string]*cmds.Command{
70
"mount": mountCmd,
71
"block": blockCmd,
72
"update": updateCmd,
73
-
74
- // test subcommands
75
- // TODO: remove these when we don't need them anymore
76
- "beep": &cmds.Command{
77
- Run: func(res cmds.Response, req cmds.Request) {
78
- v := &TestOutput{"hello, world", 1337}
79
- log.Info("beep")
80
- res.SetOutput(v)
81
- },
82
- Marshallers: map[cmds.EncodingType]cmds.Marshaller{
83
- cmds.Text: func(res cmds.Response) ([]byte, error) {
84
- v := res.Output().(*TestOutput)
85
- s := fmt.Sprintf("Foo: %s\n", v.Foo)
86
- s += fmt.Sprintf("Bar: %v\n", v.Bar)
87
- return []byte(s), nil
88
- },
89
- },
90
- Type: &TestOutput{},
91
- },
92
- // TODO rm
93
- "boop": &cmds.Command{
94
- Run: func(res cmds.Response, req cmds.Request) {
95
- v := strings.NewReader("hello, world")
96
- res.SetOutput(v)
97
- },
98
- },
99
- // TODO rm
100
- "warp": &cmds.Command{
101
- Options: []cmds.Option{
102
- cmds.Option{[]string{"power", "p"}, cmds.Float},
103
- },
104
- Run: func(res cmds.Response, req cmds.Request) {
105
- threshold := 1.21
106
-
107
- if power, found := req.Option("power"); found && power.(float64) >= threshold {
108
- res.SetOutput(struct {
109
- Status string
110
- Power float64
111
- }{"Flux capacitor activated!", power.(float64)})
112
-
113
- } else {
114
- err := fmt.Errorf("Insufficient power (%v jiggawatts required)", threshold)
115
- res.SetError(err, cmds.ErrClient)
116
- }
117
- },
118
- },
119
- // TODO rm
120
- "args": &cmds.Command{
121
- Run: func(res cmds.Response, req cmds.Request) {
122
- res.SetOutput(req.Arguments())
123
- },
124
- },
73
}
74
75
func init() {