|
|
|
@ -203,12 +203,9 @@ func withEnvHint(envVars []string, str string) string {
|
|
|
|
|
return str + envText
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func flagNames(f Flag) []string {
|
|
|
|
|
func flagNames(name string, aliases []string) []string {
|
|
|
|
|
var ret []string
|
|
|
|
|
|
|
|
|
|
name := flagStringField(f, "Name")
|
|
|
|
|
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
|
|
|
|
@ -231,17 +228,6 @@ func flagStringSliceField(f Flag, name string) []string {
|
|
|
|
|
return []string{}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func flagStringField(f Flag, name string) string {
|
|
|
|
|
fv := flagValue(f)
|
|
|
|
|
field := fv.FieldByName(name)
|
|
|
|
|
|
|
|
|
|
if field.IsValid() {
|
|
|
|
|
return field.String()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func withFileHint(filePath, str string) string {
|
|
|
|
|
fileText := ""
|
|
|
|
|
if filePath != "" {
|
|
|
|
|