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: Note commands which need obscured input in the docs - fixes #4252

Nick Craig-Wood8774381e2ef6
diff --git a/cmd/cmd.go b/cmd/cmd.go
index b8044fe63..1d606a4d4 100644
--- a/cmd/cmd.go
+++ b/cmd/cmd.go
@@ -486,6 +486,9 @@ func AddBackendFlags() {
help = help[:nl]
}
help = strings.TrimSpace(help)
+ if opt.IsPassword {
+ help += " (obscured)"
+ }
flag := pflag.CommandLine.VarPF(opt, name, opt.ShortOpt, help)
if _, isBool := opt.Default.(bool); isBool {
flag.NoOptDefVal = "true"
diff --git a/cmd/help.go b/cmd/help.go
index 509a8e739..b73a09bea 100644
--- a/cmd/help.go
+++ b/cmd/help.go
@@ -325,6 +325,9 @@ func showBackend(name string) {
}
fmt.Printf("#### --%s%s\n\n", opt.FlagName(backend.Prefix), shortOpt)
fmt.Printf("%s\n\n", opt.Help)
+ if opt.IsPassword {
+ fmt.Printf("**NB** Input to this must be obscured - see [rclone obscure](/commands/rclone_obscure/).\n\n")
+ }
fmt.Printf("- Config: %s\n", opt.Name)
fmt.Printf("- Env Var: %s\n", opt.EnvVarName(backend.Prefix))
fmt.Printf("- Type: %s\n", opt.Type())