1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-04 09:33:36 +00:00

cmd: fix environment variables not setting command line flags

Before this fix quite a lot of the commands were ignoring environment
variables intended to set flags.
This commit is contained in:
Nick Craig-Wood
2019-10-11 16:55:04 +01:00
parent 19429083ad
commit 1b2ffbeca0
24 changed files with 140 additions and 105 deletions

View File

@@ -82,10 +82,10 @@ func Int64P(name, shorthand string, value int64, usage string) (out *int64) {
return out
}
// IntVar64P defines a flag which can be overridden by an environment variable
// Int64VarP defines a flag which can be overridden by an environment variable
//
// It is a thin wrapper around pflag.Int64VarP
func IntVar64P(flags *pflag.FlagSet, p *int64, name, shorthand string, value int64, usage string) {
func Int64VarP(flags *pflag.FlagSet, p *int64, name, shorthand string, value int64, usage string) {
flags.Int64VarP(p, name, shorthand, value, usage)
setDefaultFromEnv(flags, name)
}