flags

package
v0.72.1-alpha2024011001 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package flags provides Terragrunt command flags.

Index

Constants

View Source
const (
	DeprecatedEnvVarPrefix   = "TERRAGRUNT_"
	DeprecatedFlagNamePrefix = "terragrunt-"
)
View Source
const (
	LogLevelFlagName        = "log-level"
	LogDisableFlagName      = "log-disable"
	ShowLogAbsPathsFlagName = "log-show-abs-paths"
	LogFormatFlagName       = "log-format"
	LogCustomFormatFlagName = "log-custom-format"
	NoColorFlagName         = "no-color"

	NonInteractiveFlagName = "non-interactive"
	WorkingDirFlagName     = "working-dir"

	StrictModeFlagName    = "strict-mode"
	StrictControlFlagName = "strict-control"

	ExperimentModeFlagName = "experiment-mode"
	ExperimentFlagName     = "experiment"

	HelpFlagName    = "help"
	VersionFlagName = "version"

	TerragruntDisableLogFormattingFlagName = DeprecatedFlagNamePrefix + "disable-log-formatting"
	TerragruntJSONLogFlagName              = DeprecatedFlagNamePrefix + "json-log"
)
View Source
const EnvVarPrefix = "TG_"

Variables

This section is empty.

Functions

func EnvVars

func EnvVars(names ...string) []string

EnvVars calls `EnvVarsWithPrefix` with a default `EnvVarPrefix` prefix.

func EnvVarsWithPrefix

func EnvVarsWithPrefix(prefix string, names ...string) []string

EnvVarsWithPrefix converts the given flag names into their corresponding environment variables, with a given `prefix` added.

func FlagNames

func FlagNames(prefix string, names ...string) []string

FlagNames returns the given names with the given prefix added.

func HelpAction

func HelpAction(ctx *cli.Context, opts *options.TerragruntOptions) error

func NewGlobalFlags

func NewGlobalFlags(opts *options.TerragruntOptions) cli.Flags

NewGlobalFlags creates and returns flags common to all commands.

func NewHelpVersionFlags

func NewHelpVersionFlags(opts *options.TerragruntOptions) cli.Flags

func NewLogLevelFlag

func NewLogLevelFlag(opts *options.TerragruntOptions) cli.Flag

func VersionAction

func VersionAction(ctx *cli.Context, _ *options.TerragruntOptions) error

Types

type Flag

type Flag struct {
	cli.Flag
	// contains filtered or unexported fields
}

Flag is a wrapper for `cli.Flag` to avoid displaying deprecated names in help.

func BoolWithDeprecatedFlag

func BoolWithDeprecatedFlag(opts *options.TerragruntOptions, flag *cli.BoolFlag, oldNames ...string) *Flag

BoolWithDeprecatedFlag adds deprecated names with strict mode control for the given flag. If `oldNames` is not specified, names are derived from the given `flag` value with added `terragrunt-/TERRAGRUNT_` prefixes.

func GenericWithDeprecatedFlag

func GenericWithDeprecatedFlag[T cli.GenericType](opts *options.TerragruntOptions, flag *cli.GenericFlag[T], oldNames ...string) *Flag

GenericWithDeprecatedFlag adds deprecated names with strict mode control for the given flag. If `oldNames` is not specified, names are derived from the given `flag` value with added `terragrunt-/TERRAGRUNT_` prefixes.

func MapWithDeprecatedFlag

func MapWithDeprecatedFlag[K cli.MapFlagKeyType, V cli.MapFlagValueType](opts *options.TerragruntOptions, flag *cli.MapFlag[K, V], oldNames ...string) *Flag

MapWithDeprecatedFlag adds deprecated names with strict mode control for the given flag. If `oldNames` is not specified, names are derived from the given `flag` value with added `terragrunt-/TERRAGRUNT_` prefixes.

func SliceWithDeprecatedFlag

func SliceWithDeprecatedFlag[T cli.SliceFlagType](opts *options.TerragruntOptions, flag *cli.SliceFlag[T], oldNames ...string) *Flag

SliceWithDeprecatedFlag adds deprecated names with strict mode control for the given flag. If `oldNames` is not specified, names are derived from the given `flag` value with added `terragrunt-/TERRAGRUNT_` prefixes.

func (*Flag) GetEnvVars

func (flag *Flag) GetEnvVars() []string

GetEnvVars returns flag envs without deprecated renamedNames to avoid showing them in help.

func (*Flag) Names

func (flag *Flag) Names() []string

Names returns flag renamedNames without deprecated renamedNames to avoid showing them in help.

func (*Flag) RunAction

func (flag *Flag) RunAction(ctx *cli.Context) error

RunAction checks for use of deprecated flag renamedNames/envs and runs the inherited `RunAction` function.

func (*Flag) String

func (flag *Flag) String() string

String returns a readable representation of this value (for usage defaults).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL