cmd: Note commands which need obscured input in the docs - fixes #4252

This commit is contained in:
Nick Craig-Wood 2020-05-31 12:57:28 +01:00
parent cbfe7a405b
commit 8774381e2e
2 changed files with 6 additions and 0 deletions

View File

@ -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"

View File

@ -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())