cmd

package
v0.63.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MPL-2.0 Imports: 37 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ExitCodeOK int = iota
	ExitCodeError
	ExitCodeIssuesFound
)

Exit codes are int values that represent an exit code for a particular error.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	// contains filtered or unexported fields
}

CLI is the command line object

func NewCLI

func NewCLI(outStream io.Writer, errStream io.Writer) (*CLI, error)

NewCLI returns new CLI initialized by input streams

func (*CLI) Run

func (cli *CLI) Run(args []string) int

Run invokes the CLI with the given arguments.

type ModuleVersionOutput added in v0.61.0

type ModuleVersionOutput struct {
	Path    string          `json:"path"`
	Plugins []PluginVersion `json:"plugins"`
}

ModuleVersionOutput represents plugins for a specific module

type Options

type Options struct {
	Version                bool     `short:"v" long:"version" description:"Print TFLint version"`
	Init                   bool     `long:"init" description:"Install plugins"`
	Langserver             bool     `long:"langserver" description:"Start language server"`
	Format                 string   `` /* 149-byte string literal not displayed */
	Config                 string   `short:"c" long:"config" description:"Config file name (default: .tflint.hcl)" value-name:"FILE"`
	IgnoreModules          []string `long:"ignore-module" description:"Ignore module sources" value-name:"SOURCE"`
	EnableRules            []string `long:"enable-rule" description:"Enable rules from the command line" value-name:"RULE_NAME"`
	DisableRules           []string `long:"disable-rule" description:"Disable rules from the command line" value-name:"RULE_NAME"`
	Only                   []string `` /* 133-byte string literal not displayed */
	EnablePlugins          []string `long:"enable-plugin" description:"Enable plugins from the command line" value-name:"PLUGIN_NAME"`
	Varfiles               []string `long:"var-file" description:"Terraform variable file name" value-name:"FILE"`
	Variables              []string `long:"var" description:"Set a Terraform variable" value-name:"'foo=bar'"`
	CallModuleType         *string  `long:"call-module-type" description:"Types of module to call (default: local)" choice:"all" choice:"local" choice:"none"`
	Chdir                  string   `long:"chdir" description:"Switch to a different working directory before executing the command" value-name:"DIR"`
	Recursive              bool     `long:"recursive" description:"Run command in each directory recursively"`
	Filter                 []string `long:"filter" description:"Filter issues by file names or globs" value-name:"FILE"`
	Force                  *bool    `long:"force" description:"Return zero exit status even if issues found"`
	MinimumFailureSeverity string   `` /* 160-byte string literal not displayed */
	Color                  bool     `long:"color" description:"Enable colorized output"`
	NoColor                bool     `long:"no-color" description:"Disable colorized output"`
	Fix                    bool     `long:"fix" description:"Fix issues automatically"`
	NoParallelRunners      bool     `long:"no-parallel-runners" description:"Disable per-runner parallelism"`
	MaxWorkers             *int     `` /* 127-byte string literal not displayed */
	ActAsBundledPlugin     bool     `long:"act-as-bundled-plugin" hidden:"true"`
	ActAsWorker            bool     `long:"act-as-worker" hidden:"true"`
}

Options is an option specified by arguments.

type PluginVersion added in v0.61.0

type PluginVersion struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

PluginVersion represents a plugin's name and version

type VersionOutput added in v0.61.0

type VersionOutput struct {
	Version            string                `json:"version"`
	Plugins            []PluginVersion       `json:"plugins,omitempty"`
	Modules            []ModuleVersionOutput `json:"modules,omitempty"`
	UpdateCheckEnabled bool                  `json:"update_check_enabled"`
	UpdateAvailable    bool                  `json:"update_available"`
	LatestVersion      string                `json:"latest_version,omitempty"`
}

VersionOutput is the JSON output structure for version command

Jump to

Keyboard shortcuts

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