Commit c19bdf18 authored by Matt Bell's avatar Matt Bell

commands: Added Request#SetOptions

parent 57c48adf
...@@ -61,6 +61,7 @@ type Request interface { ...@@ -61,6 +61,7 @@ type Request interface {
Option(name string) *OptionValue Option(name string) *OptionValue
Options() optMap Options() optMap
SetOption(name string, val interface{}) SetOption(name string, val interface{})
SetOptions(opts map[string]interface{}) error
Arguments() []string Arguments() []string
SetArguments([]string) SetArguments([]string)
Files() File Files() File
...@@ -144,6 +145,12 @@ func (r *request) SetOption(name string, val interface{}) { ...@@ -144,6 +145,12 @@ func (r *request) SetOption(name string, val interface{}) {
r.options[name] = val r.options[name] = val
} }
// SetOptions sets the option values, unsetting any values that were previously set
func (r *request) SetOptions(opts map[string]interface{}) error {
r.options = opts
return r.ConvertOptions()
}
// Arguments returns the arguments slice // Arguments returns the arguments slice
func (r *request) Arguments() []string { func (r *request) Arguments() []string {
return r.arguments return r.arguments
......
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