cli: Add reference to global options to help text
This commit is contained in:
parent
1de8216a9e
commit
94340b5940
|
@ -261,7 +261,7 @@ func (c *ApplyCommand) Synopsis() string {
|
|||
|
||||
func (c *ApplyCommand) helpApply() string {
|
||||
helpText := `
|
||||
Usage: terraform apply [options] [PLAN]
|
||||
Usage: terraform [global options] apply [options] [PLAN]
|
||||
|
||||
Creates or updates infrastructure according to Terraform configuration
|
||||
files in the current directory.
|
||||
|
@ -323,7 +323,7 @@ Options:
|
|||
|
||||
func (c *ApplyCommand) helpDestroy() string {
|
||||
helpText := `
|
||||
Usage: terraform destroy [options]
|
||||
Usage: terraform [global options] destroy [options]
|
||||
|
||||
Destroy Terraform-managed infrastructure.
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ func (c *ConsoleCommand) modePiped(session *repl.Session, ui cli.Ui) int {
|
|||
|
||||
func (c *ConsoleCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform console [options]
|
||||
Usage: terraform [global options] console [options]
|
||||
|
||||
Starts an interactive console for experimenting with Terraform
|
||||
interpolations.
|
||||
|
|
|
@ -494,7 +494,7 @@ func (c *FmtCommand) trimNewlines(tokens hclwrite.Tokens) hclwrite.Tokens {
|
|||
|
||||
func (c *FmtCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform fmt [options] [DIR]
|
||||
Usage: terraform [global options] fmt [options] [DIR]
|
||||
|
||||
Rewrites all Terraform configuration files to a canonical format. Both
|
||||
configuration files (.tf) and variables files (.tfvars) are updated.
|
||||
|
|
|
@ -44,7 +44,7 @@ func (c *GetCommand) Run(args []string) int {
|
|||
|
||||
func (c *GetCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform get [options] PATH
|
||||
Usage: terraform [global options] get [options] PATH
|
||||
|
||||
Downloads and installs modules needed for the configuration given by
|
||||
PATH.
|
||||
|
|
|
@ -163,7 +163,7 @@ func (c *GraphCommand) Run(args []string) int {
|
|||
|
||||
func (c *GraphCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform graph [options]
|
||||
Usage: terraform [global options] graph [options]
|
||||
|
||||
Outputs the visual execution graph of Terraform resources according to
|
||||
either the current configuration or an execution plan.
|
||||
|
|
|
@ -271,7 +271,7 @@ func (c *ImportCommand) Run(args []string) int {
|
|||
|
||||
func (c *ImportCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform import [options] ADDR ID
|
||||
Usage: terraform [global options] import [options] ADDR ID
|
||||
|
||||
Import existing infrastructure into your Terraform state.
|
||||
|
||||
|
|
|
@ -909,7 +909,7 @@ func (c *InitCommand) AutocompleteFlags() complete.Flags {
|
|||
|
||||
func (c *InitCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform init [options]
|
||||
Usage: terraform [global options] init [options]
|
||||
|
||||
Initialize a new or existing Terraform working directory by creating
|
||||
initial files, loading any remote state, downloading modules, etc.
|
||||
|
|
|
@ -249,7 +249,7 @@ func (c *LoginCommand) Help() string {
|
|||
}
|
||||
|
||||
helpText := fmt.Sprintf(`
|
||||
Usage: terraform login [hostname]
|
||||
Usage: terraform [global options] login [hostname]
|
||||
|
||||
Retrieves an authentication token for the given hostname, if it supports
|
||||
automatic login, and saves it in a credentials file in your home directory.
|
||||
|
|
|
@ -132,7 +132,7 @@ func (c *LogoutCommand) Help() string {
|
|||
}
|
||||
|
||||
helpText := `
|
||||
Usage: terraform logout [hostname]
|
||||
Usage: terraform [global options] logout [hostname]
|
||||
|
||||
Removes locally-stored credentials for specified hostname.
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ func (c *OutputCommand) Outputs(statePath string) (map[string]*states.OutputValu
|
|||
|
||||
func (c *OutputCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform output [options] [NAME]
|
||||
Usage: terraform [global options] output [options] [NAME]
|
||||
|
||||
Reads an output variable from a Terraform state file and prints
|
||||
the value. With no additional arguments, output will display all
|
||||
|
|
|
@ -187,7 +187,7 @@ func (c *PlanCommand) Run(args []string) int {
|
|||
|
||||
func (c *PlanCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform plan [options]
|
||||
Usage: terraform [global options] plan [options]
|
||||
|
||||
Generates a speculative execution plan, showing what actions Terraform
|
||||
would take to apply the current configuration. This command will not
|
||||
|
|
|
@ -149,7 +149,7 @@ func (c *ProvidersCommand) populateTreeNode(tree treeprint.Tree, node *configs.M
|
|||
}
|
||||
|
||||
const providersCommandHelp = `
|
||||
Usage: terraform providers [dir]
|
||||
Usage: terraform [global options] providers [dir]
|
||||
|
||||
Prints out a tree of modules in the referenced configuration annotated with
|
||||
their provider requirements.
|
||||
|
|
|
@ -301,7 +301,7 @@ func (c *ProvidersLockCommand) Run(args []string) int {
|
|||
|
||||
func (c *ProvidersLockCommand) Help() string {
|
||||
return `
|
||||
Usage: terraform providers lock [options] [providers...]
|
||||
Usage: terraform [global options] providers lock [options] [providers...]
|
||||
|
||||
Normally the dependency lock file (.terraform.lock.hcl) is updated
|
||||
automatically by "terraform init", but the information available to the
|
||||
|
|
|
@ -329,7 +329,7 @@ func (c *ProvidersMirrorCommand) Run(args []string) int {
|
|||
|
||||
func (c *ProvidersMirrorCommand) Help() string {
|
||||
return `
|
||||
Usage: terraform providers mirror [options] <target-dir>
|
||||
Usage: terraform [global options] providers mirror [options] <target-dir>
|
||||
|
||||
Populates a local directory with copies of the provider plugins needed for
|
||||
the current configuration, so that the directory can be used either directly
|
||||
|
|
|
@ -108,7 +108,7 @@ func (c *ProvidersSchemaCommand) Run(args []string) int {
|
|||
}
|
||||
|
||||
const providersSchemaCommandHelp = `
|
||||
Usage: terraform providers schema -json
|
||||
Usage: terraform [global options] providers schema -json
|
||||
|
||||
Prints out a json representation of the schemas for all providers used
|
||||
in the current configuration.
|
||||
|
|
|
@ -23,7 +23,7 @@ func (c *PushCommand) Run(args []string) int {
|
|||
|
||||
func (c *PushCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform push [options] [DIR]
|
||||
Usage: terraform [global options] push [options] [DIR]
|
||||
|
||||
This command was for the legacy version of Terraform Enterprise (v1), which
|
||||
has now reached end-of-life. Therefore this command is no longer supported.
|
||||
|
|
|
@ -120,7 +120,7 @@ func (c *RefreshCommand) Run(args []string) int {
|
|||
|
||||
func (c *RefreshCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform refresh [options]
|
||||
Usage: terraform [global options] refresh [options]
|
||||
|
||||
Update the state file of your infrastructure with metadata that matches
|
||||
the physical resources they are tracking.
|
||||
|
|
|
@ -190,7 +190,7 @@ func (c *ShowCommand) Run(args []string) int {
|
|||
|
||||
func (c *ShowCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform show [options] [path]
|
||||
Usage: terraform [global options] show [options] [path]
|
||||
|
||||
Reads and outputs a Terraform state or plan file in a human-readable
|
||||
form. If no path is specified, the current state will be shown.
|
||||
|
|
|
@ -18,7 +18,7 @@ func (c *StateCommand) Run(args []string) int {
|
|||
|
||||
func (c *StateCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform state <subcommand> [options] [args]
|
||||
Usage: terraform [global options] state <subcommand> [options] [args]
|
||||
|
||||
This command has subcommands for advanced state management.
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ func (c *StateListCommand) Run(args []string) int {
|
|||
|
||||
func (c *StateListCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform state list [options] [address...]
|
||||
Usage: terraform [global options] state list [options] [address...]
|
||||
|
||||
List resources in the Terraform state.
|
||||
|
||||
|
|
|
@ -454,7 +454,7 @@ func (c *StateMvCommand) validateResourceMove(addrFrom, addrTo addrs.AbsResource
|
|||
|
||||
func (c *StateMvCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform state mv [options] SOURCE DESTINATION
|
||||
Usage: terraform [global options] state mv [options] SOURCE DESTINATION
|
||||
|
||||
This command will move an item matched by the address given to the
|
||||
destination address. This command can also move to a destination address
|
||||
|
|
|
@ -68,7 +68,7 @@ func (c *StatePullCommand) Run(args []string) int {
|
|||
|
||||
func (c *StatePullCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform state pull [options]
|
||||
Usage: terraform [global options] state pull [options]
|
||||
|
||||
Pull the state from its location, upgrade the local copy, and output it
|
||||
to stdout.
|
||||
|
|
|
@ -135,7 +135,7 @@ func (c *StatePushCommand) Run(args []string) int {
|
|||
|
||||
func (c *StatePushCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform state push [options] PATH
|
||||
Usage: terraform [global options] state push [options] PATH
|
||||
|
||||
Update remote state from a local state file at PATH.
|
||||
|
||||
|
|
|
@ -171,7 +171,7 @@ func (c *StateReplaceProviderCommand) Run(args []string) int {
|
|||
|
||||
func (c *StateReplaceProviderCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform state replace-provider [options] FROM_PROVIDER_FQN TO_PROVIDER_FQN
|
||||
Usage: terraform [global options] state replace-provider [options] FROM_PROVIDER_FQN TO_PROVIDER_FQN
|
||||
|
||||
Replace provider for resources in the Terraform state.
|
||||
|
||||
|
|
|
@ -285,7 +285,7 @@ func TestStateReplaceProvider(t *testing.T) {
|
|||
func TestStateReplaceProvider_docs(t *testing.T) {
|
||||
c := &StateReplaceProviderCommand{}
|
||||
|
||||
if got, want := c.Help(), "Usage: terraform state replace-provider"; !strings.Contains(got, want) {
|
||||
if got, want := c.Help(), "Usage: terraform [global options] state replace-provider"; !strings.Contains(got, want) {
|
||||
t.Fatalf("unexpected help text\nwant: %s\nfull output:\n%s", want, got)
|
||||
}
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ func (c *StateRmCommand) Run(args []string) int {
|
|||
|
||||
func (c *StateRmCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform state rm [options] ADDRESS...
|
||||
Usage: terraform [global options] state rm [options] ADDRESS...
|
||||
|
||||
Remove one or more items from the Terraform state, causing Terraform to
|
||||
"forget" those items without first destroying them in the remote system.
|
||||
|
|
|
@ -145,7 +145,7 @@ func (c *StateShowCommand) Run(args []string) int {
|
|||
|
||||
func (c *StateShowCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform state show [options] ADDRESS
|
||||
Usage: terraform [global options] state show [options] ADDRESS
|
||||
|
||||
Shows the attributes of a resource in the Terraform state.
|
||||
|
||||
|
|
|
@ -207,7 +207,7 @@ func (c *TaintCommand) Run(args []string) int {
|
|||
|
||||
func (c *TaintCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform taint [options] <address>
|
||||
Usage: terraform [global options] taint [options] <address>
|
||||
|
||||
Terraform uses the term "tainted" to describe a resource instance
|
||||
which may not be fully functional, either because its creation
|
||||
|
|
|
@ -116,7 +116,7 @@ func (c *UnlockCommand) Run(args []string) int {
|
|||
|
||||
func (c *UnlockCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform force-unlock LOCK_ID
|
||||
Usage: terraform [global options] force-unlock LOCK_ID
|
||||
|
||||
Manually unlock the state for the defined configuration.
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ func (c *UntaintCommand) Run(args []string) int {
|
|||
|
||||
func (c *UntaintCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform untaint [options] name
|
||||
Usage: terraform [global options] untaint [options] name
|
||||
|
||||
Terraform uses the term "tainted" to describe a resource instance
|
||||
which may not be fully functional, either because its creation
|
||||
|
|
|
@ -240,7 +240,7 @@ func (c *ValidateCommand) Synopsis() string {
|
|||
|
||||
func (c *ValidateCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform validate [options] [dir]
|
||||
Usage: terraform [global options] validate [options] [dir]
|
||||
|
||||
Validate the configuration files in a directory, referring only to the
|
||||
configuration and not accessing any remote services such as remote state,
|
||||
|
|
|
@ -44,7 +44,7 @@ type VersionCheckInfo struct {
|
|||
|
||||
func (c *VersionCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform version [options]
|
||||
Usage: terraform [global options] version [options]
|
||||
|
||||
Displays the version of Terraform and all installed plugins
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ func (c *WorkspaceCommand) Run(args []string) int {
|
|||
|
||||
func (c *WorkspaceCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform workspace
|
||||
Usage: terraform [global options] workspace
|
||||
|
||||
new, list, show, select and delete Terraform workspaces.
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ func (c *WorkspaceDeleteCommand) AutocompleteFlags() complete.Flags {
|
|||
|
||||
func (c *WorkspaceDeleteCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform workspace delete [OPTIONS] NAME
|
||||
Usage: terraform [global options] workspace delete [OPTIONS] NAME
|
||||
|
||||
Delete a Terraform workspace
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ func (c *WorkspaceListCommand) AutocompleteFlags() complete.Flags {
|
|||
|
||||
func (c *WorkspaceListCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform workspace list
|
||||
Usage: terraform [global options] workspace list
|
||||
|
||||
List Terraform workspaces.
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ func (c *WorkspaceNewCommand) AutocompleteFlags() complete.Flags {
|
|||
|
||||
func (c *WorkspaceNewCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform workspace new [OPTIONS] NAME
|
||||
Usage: terraform [global options] workspace new [OPTIONS] NAME
|
||||
|
||||
Create a new Terraform workspace.
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ func (c *WorkspaceSelectCommand) AutocompleteFlags() complete.Flags {
|
|||
|
||||
func (c *WorkspaceSelectCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform workspace select NAME
|
||||
Usage: terraform [global options] workspace select NAME
|
||||
|
||||
Select a different Terraform workspace.
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ func (c *WorkspaceShowCommand) AutocompleteFlags() complete.Flags {
|
|||
|
||||
func (c *WorkspaceShowCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: terraform workspace show
|
||||
Usage: terraform [global options] workspace show
|
||||
|
||||
Show the name of the current workspace.
|
||||
`
|
||||
|
|
Loading…
Reference in New Issue