Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-cmds
Commits
2d3070c9
Commit
2d3070c9
authored
Nov 10, 2014
by
Matt Bell
Committed by
Juan Batiz-Benet
Nov 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: Made SetOption override existing values (even if they used a different alias)
parent
10837a6d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
request.go
request.go
+15
-0
No files found.
request.go
View file @
2d3070c9
...
...
@@ -81,6 +81,21 @@ func (r *request) Options() map[string]interface{} {
// SetOption sets the value of the option for given name.
func
(
r
*
request
)
SetOption
(
name
string
,
val
interface
{})
{
// find the option with the specified name
option
,
found
:=
r
.
optionDefs
[
name
]
if
!
found
{
return
}
// try all the possible names, if we already have a value then set over it
for
_
,
n
:=
range
option
.
Names
{
val
,
found
:=
r
.
options
[
n
]
if
found
{
r
.
options
[
n
]
=
val
return
}
}
r
.
options
[
name
]
=
val
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment