add todo
Brian Tiger Chow committed
Nov 11, 2014 at 22:23 UTC
94e8218be8b354d8b98abad82f6c99ed8783d1c0
1 file changed
+7
commands/option.go
+7
@@ -29,6 +29,7 @@ type Option struct {
29
// constructor helper functions
30
func NewOption(kind reflect.Kind, names ...string) Option {
31
if len(names) < 2 {
32
+ // FIXME(btc) don't panic (fix_before_merge)
33
panic("Options require at least two string values (name and description)")
34
}
35
@@ -42,6 +43,12 @@ func NewOption(kind reflect.Kind, names ...string) Option {
43
}
44
}
45
46
+// TODO handle description separately. this will take care of the panic case in
47
+// NewOption
48
+
49
+// For all func {Type}Option(...string) functions, the last variadic argument
50
+// is treated as the description field.
51
+
52
func BoolOption(names ...string) Option {
53
return NewOption(Bool, names...)
54
}