From 004d1598d0a443b9e260a20d7602ec54972185d0 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 3 Nov 2016 12:40:59 -0600 Subject: [PATCH] Add a tags field for user defined tags on a Command. Signed-off-by: Daniel Nephin --- command.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/command.go b/command.go index 3ee1a0a9..57c5fcd6 100644 --- a/command.go +++ b/command.go @@ -57,6 +57,9 @@ type Command struct { Deprecated string // Is this command hidden and should NOT show up in the list of available commands? Hidden bool + // Annotations are key/value pairs that can be used by applications to identify or + // group commands + Annotations map[string]string // Full set of flags flags *flag.FlagSet // Set of flags childrens of this command will inherit @@ -455,7 +458,7 @@ func argsMinusFirstX(args []string, x string) []string { return args } -// Find finds the target command given the args and command tree +// Find the target command given the args and command tree // Meant to be run on the highest node. Only searches down. func (c *Command) Find(args []string) (*Command, []string, error) { if c == nil {