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-unixfs
Commits
57064718
Commit
57064718
authored
Jan 22, 2015
by
Matt Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: Made PostRun signature match Run
parent
79741438
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
cmd/ipfs/main.go
cmd/ipfs/main.go
+1
-1
commands/command.go
commands/command.go
+1
-1
core/commands/add.go
core/commands/add.go
+3
-3
core/commands/cat.go
core/commands/cat.go
+1
-1
No files found.
cmd/ipfs/main.go
View file @
57064718
...
...
@@ -356,7 +356,7 @@ func callCommand(ctx context.Context, req cmds.Request, root *cmds.Command, cmd
}
if
cmd
.
PostRun
!=
nil
{
cmd
.
PostRun
(
res
)
cmd
.
PostRun
(
req
,
res
)
}
return
res
,
nil
...
...
commands/command.go
View file @
57064718
...
...
@@ -47,7 +47,7 @@ type Command struct {
Arguments
[]
Argument
PreRun
func
(
req
Request
)
error
Run
Function
PostRun
f
unc
(
res
Response
)
PostRun
F
unc
tion
Marshalers
map
[
EncodingType
]
Marshaler
Helptext
HelpText
...
...
core/commands/add.go
View file @
57064718
...
...
@@ -104,7 +104,7 @@ remains to be implemented.
}
}()
},
PostRun
:
func
(
res
cmds
.
Response
)
{
PostRun
:
func
(
req
cmds
.
Request
,
res
cmds
.
Response
)
{
outChan
,
ok
:=
res
.
Output
()
.
(
<-
chan
interface
{})
if
!
ok
{
res
.
SetError
(
u
.
ErrCast
(),
cmds
.
ErrNormal
)
...
...
@@ -112,14 +112,14 @@ remains to be implemented.
}
res
.
SetOutput
(
nil
)
quiet
,
_
,
err
:=
re
s
.
Request
()
.
Option
(
"quiet"
)
.
Bool
()
quiet
,
_
,
err
:=
re
q
.
Option
(
"quiet"
)
.
Bool
()
if
err
!=
nil
{
res
.
SetError
(
u
.
ErrCast
(),
cmds
.
ErrNormal
)
return
}
size
:=
int64
(
0
)
s
,
found
:=
re
s
.
Request
()
.
Values
()[
"size"
]
s
,
found
:=
re
q
.
Values
()[
"size"
]
if
found
{
size
=
s
.
(
int64
)
}
...
...
core/commands/cat.go
View file @
57064718
...
...
@@ -44,7 +44,7 @@ it contains.
reader
:=
io
.
MultiReader
(
readers
...
)
res
.
SetOutput
(
reader
)
},
PostRun
:
func
(
res
cmds
.
Response
)
{
PostRun
:
func
(
req
cmds
.
Request
,
res
cmds
.
Response
)
{
if
res
.
Length
()
<
progressBarMinSize
{
return
}
...
...
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