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
Commits
5e16dfb1
Commit
5e16dfb1
authored
10 years ago
by
Matt Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: Improved option conversin error message
parent
d1c50972
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
commands/request.go
commands/request.go
+6
-2
No files found.
commands/request.go
View file @
5e16dfb1
...
...
@@ -223,8 +223,12 @@ func (r *request) ConvertOptions() error {
}
val
,
err
:=
convert
(
str
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"Could not convert string value '%s' to type '%s'"
,
v
,
opt
.
Type
.
String
())
value
:=
fmt
.
Sprintf
(
"value '%v'"
,
v
)
if
len
(
str
)
==
0
{
value
=
"empty value"
}
return
fmt
.
Errorf
(
"Could not convert %s to type '%s' (for option '-%s')"
,
value
,
opt
.
Type
.
String
(),
k
)
}
r
.
options
[
k
]
=
val
...
...
This diff is collapsed.
Click to expand it.
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