Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

cmd/config(update remote): introduce --no-output option

Jess6494ac037fdd
diff --git a/cmd/config/config.go b/cmd/config/config.go
index 90630a9bc..04a8e785f 100644
--- a/cmd/config/config.go
+++ b/cmd/config/config.go
@@ -303,6 +303,9 @@ func doConfig(name string, in rc.Params, do func(config.UpdateRemoteOpt) (*fs.Co
if err != nil {
return err
}
+ if updateRemoteOpt.NoOutput {
+ return nil
+ }
if !(updateRemoteOpt.NonInteractive || updateRemoteOpt.Continue) {
config.ShowRemote(name)
} else {
@@ -323,6 +326,7 @@ func init() {
for _, cmdFlags := range []*pflag.FlagSet{configCreateCommand.Flags(), configUpdateCommand.Flags()} {
flags.BoolVarP(cmdFlags, &updateRemoteOpt.Obscure, "obscure", "", false, "Force any passwords to be obscured", "Config")
flags.BoolVarP(cmdFlags, &updateRemoteOpt.NoObscure, "no-obscure", "", false, "Force any passwords not to be obscured", "Config")
+ flags.BoolVarP(cmdFlags, &updateRemoteOpt.NoOutput, "no-output", "", false, "Don't provide any output", "Config")
flags.BoolVarP(cmdFlags, &updateRemoteOpt.NonInteractive, "non-interactive", "", false, "Don't interact with user and return questions", "Config")
flags.BoolVarP(cmdFlags, &updateRemoteOpt.Continue, "continue", "", false, "Continue the configuration process with an answer", "Config")
flags.BoolVarP(cmdFlags, &updateRemoteOpt.All, "all", "", false, "Ask the full set of config questions", "Config")
diff --git a/fs/config/config.go b/fs/config/config.go
index ca8d370da..494c179b1 100644
--- a/fs/config/config.go
+++ b/fs/config/config.go
@@ -514,6 +514,8 @@ type UpdateRemoteOpt struct {
Obscure bool `json:"obscure"`
// Treat all passwords as obscured
NoObscure bool `json:"noObscure"`
+ // Don't provide any output
+ NoOutput bool `json:"noOutput"`
// Don't interact with the user - return questions
NonInteractive bool `json:"nonInteractive"`
// If set then supply state and result parameters to continue the process
diff --git a/fs/config/rc.go b/fs/config/rc.go
index 2d7a26809..c0c0a8dc7 100644
--- a/fs/config/rc.go
+++ b/fs/config/rc.go
@@ -120,6 +120,7 @@ func init() {
extraHelp += `- opt - a dictionary of options to control the configuration
- obscure - declare passwords are plain and need obscuring
- noObscure - declare passwords are already obscured and don't need obscuring
+ - noOutput - don't print anything to stdout
- nonInteractive - don't interact with a user, return questions
- continue - continue the config process with an answer
- all - ask all the config questions not just the post config ones