1
mirror of https://github.com/rclone/rclone synced 2024-12-25 17:03:45 +01:00

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

View File

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