commands: Created a list of global options (for options owned by commands package)
Matt Bell committed
Oct 10, 2014 at 11:40 UTC
47ebf174f4e726346a651bc74ee234bbaeb6cf17
1 file changed
+11
commands/option.go
+11
@@ -15,6 +15,17 @@ const (
15
type Option struct {
16
Names []string // a list of unique names to
17
Type reflect.Kind // value must be this type
18
+
19
+ // TODO: add more features(?):
20
//Default interface{} // the default value (ignored if `Required` is true)
21
//Required bool // whether or not the option must be provided
22
}
23
+
24
+// options that are used by this package
25
+var globalOptions []Option = []Option{
26
+ Option{ []string{ "enc", "encoding" }, String },
27
+}
28
+// the above array of Options, wrapped in a Command
29
+var globalCommand *Command = &Command{
30
+ Options: globalOptions,
31
+}