cmd: fix boolean backend flags - fixes #2402

Before this change, boolean flags such as `--b2-hard-delete` were
failing to be recognised unless they had a parameter.

This bug was introduced as part of the config re-organisation:
f3f48d7d49
s3-about
Nick Craig-Wood 2018-07-18 15:43:57 +01:00
parent dcc74fa404
commit b1f31c2acf
1 changed files with 1 additions and 1 deletions

View File

@ -523,7 +523,7 @@ func AddBackendFlags() {
}
help = strings.TrimSpace(help)
flag := pflag.CommandLine.VarPF(opt, name, string(opt.ShortOpt), help)
if _, isBool := opt.Value.(bool); isBool {
if _, isBool := opt.Default.(bool); isBool {
flag.NoOptDefVal = "true"
}
// Hide on the command line if requested