"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
cmd: make backend env vars show in help as the defaults for backend flags
Nick Craig-Wood72083c65adff
diff --git a/cmd/cmd.go b/cmd/cmd.goindex ca01ecf1d..df1a208b0 100644--- a/cmd/cmd.go+++ b/cmd/cmd.go@@ -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"}diff --git a/fs/config/flags/flags.go b/fs/config/flags/flags.goindex bd27810fa..39b5db0ea 100644--- a/fs/config/flags/flags.go+++ b/fs/config/flags/flags.go@@ -156,6 +156,15 @@ func FVarP(flags *pflag.FlagSet, value pflag.Value, name, shorthand, usage strinsetDefaultFromEnv(flags, name)}+// VarPF defines a flag which can be overridden by an environment variable+//+// It is a thin wrapper around pflag.VarPF+func VarPF(flags *pflag.FlagSet, value pflag.Value, name, shorthand, usage string) *pflag.Flag {+ flag := flags.VarPF(value, name, shorthand, usage)+ setDefaultFromEnv(flags, name)+ return flag+}+// StringArrayP defines a flag which can be overridden by an environment variable//// It sets one value only - command line flags can be used to set more.