forked from cerc-io/plugeth
internal/flags: add missing flag types for auto-env-var generation (#28692)
Certain flags, such as `--rpc.txfeecap` currently do not have an env-var auto-generated for them. This change adds three missing cli flag types to the auto env-var helper function to fix this.
This commit is contained in:
parent
5b22a472d6
commit
02766d349a
@ -105,7 +105,7 @@ func MigrateGlobalFlags(ctx *cli.Context) {
|
|||||||
func doMigrateFlags(ctx *cli.Context) {
|
func doMigrateFlags(ctx *cli.Context) {
|
||||||
// Figure out if there are any aliases of commands. If there are, we want
|
// Figure out if there are any aliases of commands. If there are, we want
|
||||||
// to ignore them when iterating over the flags.
|
// to ignore them when iterating over the flags.
|
||||||
var aliases = make(map[string]bool)
|
aliases := make(map[string]bool)
|
||||||
for _, fl := range ctx.Command.Flags {
|
for _, fl := range ctx.Command.Flags {
|
||||||
for _, alias := range fl.Names()[1:] {
|
for _, alias := range fl.Names()[1:] {
|
||||||
aliases[alias] = true
|
aliases[alias] = true
|
||||||
@ -239,15 +239,24 @@ func AutoEnvVars(flags []cli.Flag, prefix string) {
|
|||||||
case *cli.StringFlag:
|
case *cli.StringFlag:
|
||||||
flag.EnvVars = append(flag.EnvVars, envvar)
|
flag.EnvVars = append(flag.EnvVars, envvar)
|
||||||
|
|
||||||
|
case *cli.StringSliceFlag:
|
||||||
|
flag.EnvVars = append(flag.EnvVars, envvar)
|
||||||
|
|
||||||
case *cli.BoolFlag:
|
case *cli.BoolFlag:
|
||||||
flag.EnvVars = append(flag.EnvVars, envvar)
|
flag.EnvVars = append(flag.EnvVars, envvar)
|
||||||
|
|
||||||
case *cli.IntFlag:
|
case *cli.IntFlag:
|
||||||
flag.EnvVars = append(flag.EnvVars, envvar)
|
flag.EnvVars = append(flag.EnvVars, envvar)
|
||||||
|
|
||||||
|
case *cli.Int64Flag:
|
||||||
|
flag.EnvVars = append(flag.EnvVars, envvar)
|
||||||
|
|
||||||
case *cli.Uint64Flag:
|
case *cli.Uint64Flag:
|
||||||
flag.EnvVars = append(flag.EnvVars, envvar)
|
flag.EnvVars = append(flag.EnvVars, envvar)
|
||||||
|
|
||||||
|
case *cli.Float64Flag:
|
||||||
|
flag.EnvVars = append(flag.EnvVars, envvar)
|
||||||
|
|
||||||
case *cli.DurationFlag:
|
case *cli.DurationFlag:
|
||||||
flag.EnvVars = append(flag.EnvVars, envvar)
|
flag.EnvVars = append(flag.EnvVars, envvar)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user