From 8774381e2ef6298aab7fc6fbedd7743600fdc84b Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 31 May 2020 12:57:28 +0100 Subject: [PATCH] cmd: Note commands which need obscured input in the docs - fixes #4252 --- cmd/cmd.go | 3 +++ cmd/help.go | 3 +++ 2 files changed, 6 insertions(+) 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())