This might not be necessary since it's just a few helper functions most users can stub out in their code, e.g.,
funcgetFlagOrEnv(s*cli.State, namestring, envPrefixstring) (string, error) {
envName:=strings.ToUpper(name)
val:=cmp.Or(
cli.GetFlag[string](s, name),
os.Getenv(envPrefix+envName),
)
ifval=="" {
return"", fmt.Errorf("must provide --%s flag or set %s environment variable", name, envName)
}
returnval, nil
}We could optionally bake this logic into the cli library or add a cli.GetFlagOrEnv helper function.
This might not be necessary since it's just a few helper functions most users can stub out in their code, e.g.,
We could optionally bake this logic into the
clilibrary or add acli.GetFlagOrEnvhelper function.