rc: set url to the first value of rc-addr since it has been converted to an array of strings now -- fixes #6641

Signed-off-by: Anagh Kumar Baranwal <6824881+darthShadow@users.noreply.github.com>
This commit is contained in:
Anagh Kumar Baranwal 2022-12-21 20:40:55 +05:30 committed by Nick Craig-Wood
parent 5ac8cfee56
commit 00e853144e
1 changed files with 9 additions and 0 deletions

View File

@ -156,6 +156,15 @@ func ParseOptions(options []string) (opt map[string]string) {
func setAlternateFlag(flagName string, output *string) {
if rcFlag := pflag.Lookup(flagName); rcFlag != nil && rcFlag.Changed {
*output = rcFlag.Value.String()
if sliceValue, ok := rcFlag.Value.(pflag.SliceValue); ok {
stringSlice := sliceValue.GetSlice()
for _, value := range stringSlice {
if value != "" {
*output = value
break
}
}
}
}
}