From 5e16dfb111935400a384186a74079be1971cc095 Mon Sep 17 00:00:00 2001 From: Matt Bell <mappum@gmail.com> Date: Sun, 16 Nov 2014 18:05:13 -0800 Subject: [PATCH] commands: Improved option conversin error message --- commands/request.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/commands/request.go b/commands/request.go index 774fdf6f3..d71011d91 100644 --- a/commands/request.go +++ b/commands/request.go @@ -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 -- GitLab