From 99600f6874c95daab762dc2373dc3ee1f6a48575 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Tue, 7 Feb 2017 16:20:48 -0500 Subject: [PATCH] Add a tags field for user defined tags on a Command. (#359) 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 {