Commit 57064718 authored by Matt Bell's avatar Matt Bell

commands: Made PostRun signature match Run

parent 79741438
...@@ -356,7 +356,7 @@ func callCommand(ctx context.Context, req cmds.Request, root *cmds.Command, cmd ...@@ -356,7 +356,7 @@ func callCommand(ctx context.Context, req cmds.Request, root *cmds.Command, cmd
} }
if cmd.PostRun != nil { if cmd.PostRun != nil {
cmd.PostRun(res) cmd.PostRun(req, res)
} }
return res, nil return res, nil
......
...@@ -47,7 +47,7 @@ type Command struct { ...@@ -47,7 +47,7 @@ type Command struct {
Arguments []Argument Arguments []Argument
PreRun func(req Request) error PreRun func(req Request) error
Run Function Run Function
PostRun func(res Response) PostRun Function
Marshalers map[EncodingType]Marshaler Marshalers map[EncodingType]Marshaler
Helptext HelpText Helptext HelpText
......
...@@ -104,7 +104,7 @@ remains to be implemented. ...@@ -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{}) outChan, ok := res.Output().(<-chan interface{})
if !ok { if !ok {
res.SetError(u.ErrCast(), cmds.ErrNormal) res.SetError(u.ErrCast(), cmds.ErrNormal)
...@@ -112,14 +112,14 @@ remains to be implemented. ...@@ -112,14 +112,14 @@ remains to be implemented.
} }
res.SetOutput(nil) res.SetOutput(nil)
quiet, _, err := res.Request().Option("quiet").Bool() quiet, _, err := req.Option("quiet").Bool()
if err != nil { if err != nil {
res.SetError(u.ErrCast(), cmds.ErrNormal) res.SetError(u.ErrCast(), cmds.ErrNormal)
return return
} }
size := int64(0) size := int64(0)
s, found := res.Request().Values()["size"] s, found := req.Values()["size"]
if found { if found {
size = s.(int64) size = s.(int64)
} }
......
...@@ -44,7 +44,7 @@ it contains. ...@@ -44,7 +44,7 @@ it contains.
reader := io.MultiReader(readers...) reader := io.MultiReader(readers...)
res.SetOutput(reader) res.SetOutput(reader)
}, },
PostRun: func(res cmds.Response) { PostRun: func(req cmds.Request, res cmds.Response) {
if res.Length() < progressBarMinSize { if res.Length() < progressBarMinSize {
return return
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment