mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
ffe056bacb
This is part of a general effort to move all of Terraform's non-library package surface under internal in order to reinforce that these are for internal use within Terraform only. If you were previously importing packages under this prefix into an external codebase, you could pin to an earlier release tag as an interim solution until you've make a plan to achieve the same functionality some other way.
41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
package command
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/mitchellh/cli"
|
|
)
|
|
|
|
// StateCommand is a Command implementation that just shows help for
|
|
// the subcommands nested below it.
|
|
type StateCommand struct {
|
|
StateMeta
|
|
}
|
|
|
|
func (c *StateCommand) Run(args []string) int {
|
|
return cli.RunResultHelp
|
|
}
|
|
|
|
func (c *StateCommand) Help() string {
|
|
helpText := `
|
|
Usage: terraform [global options] state <subcommand> [options] [args]
|
|
|
|
This command has subcommands for advanced state management.
|
|
|
|
These subcommands can be used to slice and dice the Terraform state.
|
|
This is sometimes necessary in advanced cases. For your safety, all
|
|
state management commands that modify the state create a timestamped
|
|
backup of the state prior to making modifications.
|
|
|
|
The structure and output of the commands is specifically tailored to work
|
|
well with the common Unix utilities such as grep, awk, etc. We recommend
|
|
using those tools to perform more advanced state tasks.
|
|
|
|
`
|
|
return strings.TrimSpace(helpText)
|
|
}
|
|
|
|
func (c *StateCommand) Synopsis() string {
|
|
return "Advanced state management"
|
|
}
|