1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-20 19:19:06 +08:00

commands: Made PostRun signature match Run

This commit is contained in:
Matt Bell
2015-01-22 23:21:19 -08:00
parent 79741438d9
commit 5706471897
4 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -47,7 +47,7 @@ type Command struct {
Arguments []Argument
PreRun func(req Request) error
Run Function
PostRun func(res Response)
PostRun Function
Marshalers map[EncodingType]Marshaler
Helptext HelpText

View File

@ -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 := res.Request().Option("quiet").Bool()
quiet, _, err := req.Option("quiet").Bool()
if err != nil {
res.SetError(u.ErrCast(), cmds.ErrNormal)
return
}
size := int64(0)
s, found := res.Request().Values()["size"]
s, found := req.Values()["size"]
if found {
size = s.(int64)
}

View File

@ -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
}