diff --git a/cmd/root.go b/cmd/root.go index 6576afb9..8b39cb68 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -49,11 +49,18 @@ var ( "token-expiration-time": "tokenExpirationTime", "baseurl": "baseURL", } + + warnedFlags = map[string]bool{} ) func migrateFlagNames(f *pflag.FlagSet, name string) pflag.NormalizedName { if newName, ok := flagNamesMigrations[name]; ok { - fmt.Printf("Flag --%s has been deprecated, use --%s instead\n", name, newName) + + if !warnedFlags[name] { + warnedFlags[name] = true + fmt.Printf("WARNING: Flag --%s has been deprecated, use --%s instead\n", name, newName) + } + name = newName }