From 2b288769c74e51a5fb1b449103900069f7b42e9b Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Tue, 24 May 2016 04:00:37 -0400 Subject: [PATCH] Add comment about commaWhitespace stripping of flag.Name --- flag.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flag.go b/flag.go index a1c1913..8e8bd70 100644 --- a/flag.go +++ b/flag.go @@ -614,6 +614,10 @@ func flagNames(f Flag) []string { aliases := flagStringSliceField(f, "Aliases") for _, part := range append([]string{name}, aliases...) { + // v1 -> v2 migration warning zone: + // Strip off anything after the first found comma or space, which + // *hopefully* makes it a tiny bit more obvious that unexpected behavior is + // caused by using the v1 form of stringly typed "Name". ret = append(ret, commaWhitespace.ReplaceAllString(part, "")) }