Files
opentf/internal/command/state_command.go
Kuba Martin 3b5b8ba719 Update internal/command to use OpenTF in user-provided strings. (#87)
* Update `internal/command` to use OpenTF

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Fix e2e tests.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Fix e2e tests.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Fix

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Rewrite message.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

---------

Signed-off-by: Jakub Martin <kubam@spacelift.io>
2023-08-24 10:56:05 +02:00

44 lines
1.1 KiB
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
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: opentf [global options] state <subcommand> [options] [args]
This command has subcommands for advanced state management.
These subcommands can be used to slice and dice the OpenTF 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"
}