diff --git a/cmd/ipfs/main.go b/cmd/ipfs/main.go index e50a5ca16..a0a050023 100644 --- a/cmd/ipfs/main.go +++ b/cmd/ipfs/main.go @@ -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 diff --git a/commands/command.go b/commands/command.go index f52ce7f06..c005b49cc 100644 --- a/commands/command.go +++ b/commands/command.go @@ -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 diff --git a/core/commands/add.go b/core/commands/add.go index bc157fcc3..fe86e91cf 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -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) } diff --git a/core/commands/cat.go b/core/commands/cat.go index d917b450f..58c7a6be0 100644 --- a/core/commands/cat.go +++ b/core/commands/cat.go @@ -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 }