github.com/paultyng/terraform@v0.6.11-0.20180227224804-66ff8f8bed40/command/state_command.go (about)

     1  package command
     2  
     3  import (
     4  	"strings"
     5  
     6  	"github.com/mitchellh/cli"
     7  )
     8  
     9  // StateCommand is a Command implementation that just shows help for
    10  // the subcommands nested below it.
    11  type StateCommand struct {
    12  	StateMeta
    13  }
    14  
    15  func (c *StateCommand) Run(args []string) int {
    16  	return cli.RunResultHelp
    17  }
    18  
    19  func (c *StateCommand) Help() string {
    20  	helpText := `
    21  Usage: terraform state <subcommand> [options] [args]
    22  
    23    This command has subcommands for advanced state management.
    24  
    25    These subcommands can be used to slice and dice the Terraform state.
    26    This is sometimes necessary in advanced cases. For your safety, all
    27    state management commands that modify the state create a timestamped
    28    backup of the state prior to making modifications.
    29  
    30    The structure and output of the commands is specifically tailored to work
    31    well with the common Unix utilities such as grep, awk, etc. We recommend
    32    using those tools to perform more advanced state tasks.
    33  
    34  `
    35  	return strings.TrimSpace(helpText)
    36  }
    37  
    38  func (c *StateCommand) Synopsis() string {
    39  	return "Advanced state management"
    40  }