mirror of
https://github.com/rclone/rclone.git
synced 2025-08-15 16:22:47 +02:00
cmd: make backend env vars show in help as the defaults for backend flags
Before this change RCLONE_DRIVE_CHUNK_SIZE=111M rclone help flags | grep drive-chunk-size Would show the default value, not the setting of RCLONE_DRIVE_CHUNK_SIZE as the non backend flags do. This change makes it work as expected by setting the default of the option to the environment variable. Fixes #4659
This commit is contained in:
@ -513,7 +513,7 @@ func AddBackendFlags() {
|
||||
if opt.IsPassword {
|
||||
help += " (obscured)"
|
||||
}
|
||||
flag := pflag.CommandLine.VarPF(opt, name, opt.ShortOpt, help)
|
||||
flag := flags.VarPF(pflag.CommandLine, opt, name, opt.ShortOpt, help)
|
||||
if _, isBool := opt.Default.(bool); isBool {
|
||||
flag.NoOptDefVal = "true"
|
||||
}
|
||||
|
Reference in New Issue
Block a user