Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
bb7d4683
Commit
bb7d4683
authored
Nov 07, 2014
by
Matt Bell
Committed by
Juan Batiz-Benet
Nov 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/commands2: Removed test subcommands
parent
218d5264
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
52 deletions
+0
-52
core/commands2/root.go
core/commands2/root.go
+0
-52
No files found.
core/commands2/root.go
View file @
bb7d4683
...
@@ -70,58 +70,6 @@ var rootSubcommands = map[string]*cmds.Command{
...
@@ -70,58 +70,6 @@ var rootSubcommands = map[string]*cmds.Command{
"mount"
:
mountCmd
,
"mount"
:
mountCmd
,
"block"
:
blockCmd
,
"block"
:
blockCmd
,
"update"
:
updateCmd
,
"update"
:
updateCmd
,
// test subcommands
// TODO: remove these when we don't need them anymore
"beep"
:
&
cmds
.
Command
{
Run
:
func
(
res
cmds
.
Response
,
req
cmds
.
Request
)
{
v
:=
&
TestOutput
{
"hello, world"
,
1337
}
log
.
Info
(
"beep"
)
res
.
SetOutput
(
v
)
},
Marshallers
:
map
[
cmds
.
EncodingType
]
cmds
.
Marshaller
{
cmds
.
Text
:
func
(
res
cmds
.
Response
)
([]
byte
,
error
)
{
v
:=
res
.
Output
()
.
(
*
TestOutput
)
s
:=
fmt
.
Sprintf
(
"Foo: %s
\n
"
,
v
.
Foo
)
s
+=
fmt
.
Sprintf
(
"Bar: %v
\n
"
,
v
.
Bar
)
return
[]
byte
(
s
),
nil
},
},
Type
:
&
TestOutput
{},
},
// TODO rm
"boop"
:
&
cmds
.
Command
{
Run
:
func
(
res
cmds
.
Response
,
req
cmds
.
Request
)
{
v
:=
strings
.
NewReader
(
"hello, world"
)
res
.
SetOutput
(
v
)
},
},
// TODO rm
"warp"
:
&
cmds
.
Command
{
Options
:
[]
cmds
.
Option
{
cmds
.
Option
{[]
string
{
"power"
,
"p"
},
cmds
.
Float
},
},
Run
:
func
(
res
cmds
.
Response
,
req
cmds
.
Request
)
{
threshold
:=
1.21
if
power
,
found
:=
req
.
Option
(
"power"
);
found
&&
power
.
(
float64
)
>=
threshold
{
res
.
SetOutput
(
struct
{
Status
string
Power
float64
}{
"Flux capacitor activated!"
,
power
.
(
float64
)})
}
else
{
err
:=
fmt
.
Errorf
(
"Insufficient power (%v jiggawatts required)"
,
threshold
)
res
.
SetError
(
err
,
cmds
.
ErrClient
)
}
},
},
// TODO rm
"args"
:
&
cmds
.
Command
{
Run
:
func
(
res
cmds
.
Response
,
req
cmds
.
Request
)
{
res
.
SetOutput
(
req
.
Arguments
())
},
},
}
}
func
init
()
{
func
init
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment