"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
fs: Add Exclusive parameter to Option to choose Examples only #3455
Nick Craig-Wood7ae289125260
diff --git a/fs/backend_config.go b/fs/backend_config.goindex 47fb02fbb..9516ac250 100644--- a/fs/backend_config.go+++ b/fs/backend_config.go@@ -161,6 +161,7 @@ func ConfigConfirm(state string, Default bool, name string, help string) (*ConfiValue: "false",Help: "No",}},+ Exclusive: true,},}, nil}@@ -182,9 +183,10 @@ func ConfigChooseFixed(state string, name string, help string, items []OptionExachoose := &ConfigOut{State: state,Option: &Option{- Name: name,- Help: help,- Examples: items,+ Name: name,+ Help: help,+ Examples: items,+ Exclusive: true,},}choose.Option.Default = choose.Option.Examples[0].Valuediff --git a/fs/config/ui.go b/fs/config/ui.goindex c68dc183c..dbd4a512c 100644--- a/fs/config/ui.go+++ b/fs/config/ui.go@@ -402,7 +402,7 @@ func ChooseOption(o *fs.Option, name string) string {help = append(help, example.Help)}}- in = Choose(o.Name, values, help, true)+ in = Choose(o.Name, values, help, !o.Exclusive)} else {fmt.Printf("%s> ", o.Name)in = ReadLine()diff --git a/fs/fs.go b/fs/fs.goindex c0bd0e65e..0532b24ec 100644--- a/fs/fs.go+++ b/fs/fs.go@@ -184,6 +184,7 @@ type Option struct {IsPassword bool // set if the option is a passwordNoPrefix bool // set if the option for this should not use the backend prefixAdvanced bool // set if this is an advanced config option+ Exclusive bool // set if the answer can only be one of the examples}// BaseOption is an alias for Option used internallydiff --git a/fs/fs_test.go b/fs/fs_test.goindex 1f7aba038..4dad61f01 100644--- a/fs/fs_test.go+++ b/fs/fs_test.go@@ -242,6 +242,7 @@ func TestOptionMarshalJSON(t *testing.T) {"IsPassword": false,"NoPrefix": false,"Advanced": true,+"Exclusive": false,"DefaultStr": "false","ValueStr": "true","Type": "bool"