refactor flag names - make it more explicitly

avoid the using 'reflect' package while getting flag names
This commit is contained in:
Dmitry Kutakov
2019-12-26 17:24:58 +01:00
committed by Dmitry
parent 25e0c70969
commit 8c28ae347a
16 changed files with 16 additions and 30 deletions

View File

@@ -31,7 +31,7 @@ func (f *StringFlag) String() string {
// Names returns the names of the flag
func (f *StringFlag) Names() []string {
return flagNames(f)
return flagNames(f.Name, f.Aliases)
}
// IsRequired returns whether or not the flag is required