@cryptotaxi247 / kubo / commits / c19bdf18b

commands: Added Request#SetOptions

Matt Bell committed Nov 18, 2014 at 01:24 UTC c19bdf18b2044a254d0fc490c85ce26ca89e1790
1 file changed +7
commands/request.go
+7
@@ -61,6 +61,7 @@ type Request interface {
61 Option(name string) *OptionValue
62 Options() optMap
63 SetOption(name string, val interface{})
64 + SetOptions(opts map[string]interface{}) error
65 Arguments() []string
66 SetArguments([]string)
67 Files() File
@@ -144,6 +145,12 @@ func (r *request) SetOption(name string, val interface{}) {
145 r.options[name] = val
146 }
147
148 +// SetOptions sets the option values, unsetting any values that were previously set
149 +func (r *request) SetOptions(opts map[string]interface{}) error {
150 + r.options = opts
151 + return r.ConvertOptions()
152 +}
153 +
154 // Arguments returns the arguments slice
155 func (r *request) Arguments() []string {
156 return r.arguments