diff --git a/commands/argument.go b/commands/argument.go index d8b1605e9..6c9c7a3d0 100644 --- a/commands/argument.go +++ b/commands/argument.go @@ -8,8 +8,9 @@ const ( ) type Argument struct { - Name string - Type ArgumentType - Required bool - Variadic bool + Name string + Type ArgumentType + Required bool + Variadic bool + Description string } diff --git a/commands/command.go b/commands/command.go index 351b249c5..5d9f584cd 100644 --- a/commands/command.go +++ b/commands/command.go @@ -28,7 +28,9 @@ type Marshaller func(Response) ([]byte, error) // Command is a runnable command, with input arguments and options (flags). // It can also have Subcommands, to group units of work into sets. type Command struct { + Description string Help string + Options []Option Arguments []Argument Run Function diff --git a/commands/option.go b/commands/option.go index 8dbf3c1bd..f068ec228 100644 --- a/commands/option.go +++ b/commands/option.go @@ -14,8 +14,9 @@ const ( // Option is used to specify a field that will be provided by a consumer type Option struct { - Names []string // a list of unique names to - Type reflect.Kind // value must be this type + Names []string // a list of unique names to + Type reflect.Kind // value must be this type + Description string // a short string to describe this option // TODO: add more features(?): //Default interface{} // the default value (ignored if `Required` is true) @@ -30,7 +31,8 @@ const ( // options that are used by this package var globalOptions = []Option{ - Option{[]string{EncShort, EncLong}, String}, + Option{[]string{EncShort, EncLong}, String, + "The encoding type the output should be encoded with (json, xml, or text)"}, } // the above array of Options, wrapped in a Command