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
4896123c
Commit
4896123c
authored
Oct 21, 2014
by
Matt Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: Export command Run function
parent
71ff571e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
commands/command.go
commands/command.go
+3
-3
No files found.
commands/command.go
View file @
4896123c
...
...
@@ -20,8 +20,8 @@ type Function func(Request, Response)
type
Command
struct
{
Help
string
Options
[]
Option
Run
Function
run
Function
subcommands
map
[
string
]
*
Command
}
...
...
@@ -59,7 +59,7 @@ func (c *Command) Call(req Request, out io.Writer) Response {
}
cmd
:=
cmds
[
len
(
cmds
)
-
1
]
if
cmd
.
r
un
==
nil
{
if
cmd
.
R
un
==
nil
{
res
.
SetError
(
ErrNotCallable
,
ErrClient
)
return
res
}
...
...
@@ -76,7 +76,7 @@ func (c *Command) Call(req Request, out io.Writer) Response {
return
res
}
cmd
.
r
un
(
req
,
res
)
cmd
.
R
un
(
req
,
res
)
return
res
}
...
...
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