commands: Added Request#SetOptions

This commit is contained in:
Matt Bell 2014-11-18 01:24:16 -08:00
parent 57c48adfcf
commit c19bdf18b2

View File

@ -61,6 +61,7 @@ type Request interface {
Option(name string) *OptionValue
Options() optMap
SetOption(name string, val interface{})
SetOptions(opts map[string]interface{}) error
Arguments() []string
SetArguments([]string)
Files() File
@ -144,6 +145,12 @@ func (r *request) SetOption(name string, val interface{}) {
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
func (r *request) Arguments() []string {
return r.arguments