diff --git a/commands/cli/parse.go b/commands/cli/parse.go index 8f930541f..8c01de6c4 100644 --- a/commands/cli/parse.go +++ b/commands/cli/parse.go @@ -26,7 +26,7 @@ func Parse(input []string, roots ...*cmds.Command) (cmds.Request, *cmds.Command, length := len(path) if length > maxLength { maxLength = length - req = cmds.NewRequest(path, opts, args, nil, cmd) + req = cmds.NewRequest(path, opts, args, cmd) root = r } } diff --git a/commands/http/client.go b/commands/http/client.go index 801c0241a..13be0603b 100644 --- a/commands/http/client.go +++ b/commands/http/client.go @@ -51,7 +51,7 @@ func Send(req cmds.Request) (cmds.Response, error) { } } - httpRes, err := http.Post(url+query, "application/octet-stream", req.Stream()) + httpRes, err := http.Post(url+query, "application/octet-stream", nil) if err != nil { return nil, err } diff --git a/commands/http/parse.go b/commands/http/parse.go index 86b4738d1..678f29937 100644 --- a/commands/http/parse.go +++ b/commands/http/parse.go @@ -34,7 +34,7 @@ func Parse(r *http.Request, root *cmds.Command) (cmds.Request, error) { opts, args2 := parseOptions(r) args = append(args, args2...) - return cmds.NewRequest(path, opts, args, nil, cmd), nil + return cmds.NewRequest(path, opts, args, cmd), nil } func parseOptions(r *http.Request) (map[string]interface{}, []interface{}) { diff --git a/commands/request.go b/commands/request.go index c2c89050c..c26f1773b 100644 --- a/commands/request.go +++ b/commands/request.go @@ -2,7 +2,6 @@ package commands import ( "fmt" - "io" "reflect" "strconv" @@ -25,8 +24,6 @@ type Request interface { Options() map[string]interface{} SetOption(name string, val interface{}) Arguments() []interface{} // TODO: make argument value type instead of using interface{} - Stream() io.Reader - SetStream(io.Reader) Context() *Context SetContext(Context) Command() *Command @@ -38,7 +35,6 @@ type request struct { path []string options optMap arguments []interface{} - in io.Reader cmd *Command ctx Context } @@ -73,16 +69,6 @@ func (r *request) Arguments() []interface{} { return r.arguments } -// Stream returns the input stream Reader -func (r *request) Stream() io.Reader { - return r.in -} - -// SetStream sets the value of the input stream Reader -func (r *request) SetStream(in io.Reader) { - r.in = in -} - func (r *request) Context() *Context { return &r.ctx } @@ -161,11 +147,11 @@ func (r *request) ConvertOptions(options map[string]Option) error { // NewEmptyRequest initializes an empty request func NewEmptyRequest() Request { - return NewRequest(nil, nil, nil, nil, nil) + return NewRequest(nil, nil, nil, nil) } // NewRequest returns a request initialized with given arguments -func NewRequest(path []string, opts optMap, args []interface{}, in io.Reader, cmd *Command) Request { +func NewRequest(path []string, opts optMap, args []interface{}, cmd *Command) Request { if path == nil { path = make([]string, 0) } @@ -175,5 +161,5 @@ func NewRequest(path []string, opts optMap, args []interface{}, in io.Reader, cm if args == nil { args = make([]interface{}, 0) } - return &request{path, opts, args, in, cmd, Context{}} + return &request{path, opts, args, cmd, Context{}} }