提交 5e16dfb1 作者: Matt Bell

commands: Improved option conversin error message

上级 d1c50972
......@@ -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
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论