Update help text for static variable support (#1804)

Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
This commit is contained in:
Christian Mesh 2024-07-11 11:00:18 -04:00 committed by GitHub
parent 0a53bab15d
commit ee75b40d14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
26 changed files with 242 additions and 10 deletions

View File

@ -73,6 +73,10 @@ func TestStaticPlanVariables(t *testing.T) {
// Apply plan without static variable (embedded) // Apply plan without static variable (embedded)
run("apply", planfile).Success() run("apply", planfile).Success()
// Show State
run("show", statePath).Failure().StderrContains(modErr)
run("show", stateVar, modVar, statePath).Success().Contains(`out = "placeholder"`)
// Force Unlock // Force Unlock
run("force-unlock", "ident").Failure().StderrContains(backendErr) run("force-unlock", "ident").Failure().StderrContains(backendErr)
run("force-unlock", stateVar, modVar, "ident").Failure().StderrContains("Local state cannot be unlocked by another process") run("force-unlock", stateVar, modVar, "ident").Failure().StderrContains("Local state cannot be unlocked by another process")

View File

@ -98,6 +98,15 @@ Options:
suitable for use in text editor integrations and other suitable for use in text editor integrations and other
automated systems. Always disables color. automated systems. Always disables color.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
return strings.TrimSpace(helpText) return strings.TrimSpace(helpText)
} }

View File

@ -272,6 +272,15 @@ Options:
-module-depth=n (deprecated) In prior versions of OpenTofu, specified the -module-depth=n (deprecated) In prior versions of OpenTofu, specified the
depth of modules to show in the output. depth of modules to show in the output.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
return strings.TrimSpace(helpText) return strings.TrimSpace(helpText)
} }

View File

@ -1250,6 +1250,15 @@ Options:
suitable for use in text editor integrations and other suitable for use in text editor integrations and other
automated systems. Always disables color. automated systems. Always disables color.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
return strings.TrimSpace(helpText) return strings.TrimSpace(helpText)
} }

View File

@ -135,19 +135,28 @@ Usage: tofu [global options] output [options] [NAME]
Options: Options:
-state=path Path to the state file to read. Defaults to -state=path Path to the state file to read. Defaults to
"terraform.tfstate". Ignored when remote "terraform.tfstate". Ignored when remote
state is used. state is used.
-no-color If specified, output won't contain any color. -no-color If specified, output won't contain any color.
-json If specified, machine readable output will be -json If specified, machine readable output will be
printed in JSON format. printed in JSON format.
-raw For value types that can be automatically -raw For value types that can be automatically
converted to a string, will print the raw converted to a string, will print the raw
string directly, rather than a human-oriented string directly, rather than a human-oriented
representation of the value. representation of the value.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
return strings.TrimSpace(helpText) return strings.TrimSpace(helpText)
} }

View File

@ -200,4 +200,13 @@ Options:
-test-directory=path Set the OpenTofu test directory, defaults to "tests". When set, the -test-directory=path Set the OpenTofu test directory, defaults to "tests". When set, the
test command will search for test files in the current directory and test command will search for test files in the current directory and
in the one specified by the flag. in the one specified by the flag.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `

View File

@ -404,6 +404,15 @@ Options:
Linux operating system running on an AMD64 or x86_64 Linux operating system running on an AMD64 or x86_64
CPU. Each provider is available only for a limited CPU. Each provider is available only for a limited
set of target platforms. set of target platforms.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
} }

View File

@ -381,5 +381,14 @@ Options:
Linux operating system running on an AMD64 or x86_64 Linux operating system running on an AMD64 or x86_64
CPU. Each provider is available only for a limited CPU. Each provider is available only for a limited
set of target platforms. set of target platforms.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
} }

View File

@ -140,4 +140,15 @@ Usage: tofu [global options] providers schema -json
Prints out a json representation of the schemas for all providers used Prints out a json representation of the schemas for all providers used
in the current configuration. in the current configuration.
Options:
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `

View File

@ -116,6 +116,15 @@ Options:
-json If specified, output the OpenTofu plan or state in -json If specified, output the OpenTofu plan or state in
a machine-readable form. a machine-readable form.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
return strings.TrimSpace(helpText) return strings.TrimSpace(helpText)
} }

View File

@ -135,6 +135,15 @@ Options:
resource types have an attribute named "id" whose value resource types have an attribute named "id" whose value
equals the given id string. equals the given id string.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
return strings.TrimSpace(helpText) return strings.TrimSpace(helpText)
} }

View File

@ -560,6 +560,15 @@ Options:
-ignore-remote-version A rare option used for the remote backend only. See -ignore-remote-version A rare option used for the remote backend only. See
the remote backend documentation for more information. the remote backend documentation for more information.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
-state, state-out, and -backup are legacy options supported for the local -state, state-out, and -backup are legacy options supported for the local
backend only. For more information, see the local backend's documentation. backend only. For more information, see the local backend's documentation.

View File

@ -99,6 +99,16 @@ Usage: tofu [global options] state pull [options]
The primary use of this is for state stored remotely. This command The primary use of this is for state stored remotely. This command
will still work with local state but is less useful for this. will still work with local state but is less useful for this.
Options:
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
return strings.TrimSpace(helpText) return strings.TrimSpace(helpText)
} }

View File

@ -192,6 +192,15 @@ Options:
-lock-timeout=0s Duration to retry a state lock. -lock-timeout=0s Duration to retry a state lock.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
return strings.TrimSpace(helpText) return strings.TrimSpace(helpText)
} }

View File

@ -224,6 +224,15 @@ Options:
-ignore-remote-version A rare option used for the remote backend only. See -ignore-remote-version A rare option used for the remote backend only. See
the remote backend documentation for more information. the remote backend documentation for more information.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
-state, state-out, and -backup are legacy options supported for the local -state, state-out, and -backup are legacy options supported for the local
backend only. For more information, see the local backend's documentation. backend only. For more information, see the local backend's documentation.

View File

@ -204,6 +204,15 @@ Options:
are incompatible. This may result in an unusable are incompatible. This may result in an unusable
workspace, and should be used with extreme caution. workspace, and should be used with extreme caution.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
return strings.TrimSpace(helpText) return strings.TrimSpace(helpText)
} }

View File

@ -209,6 +209,15 @@ Options:
up OpenTofu-managed resources. By default it will up OpenTofu-managed resources. By default it will
use the state "terraform.tfstate" if it exists. use the state "terraform.tfstate" if it exists.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
return strings.TrimSpace(helpText) return strings.TrimSpace(helpText)
} }

View File

@ -241,6 +241,15 @@ Options:
-ignore-remote-version A rare option used for the remote backend only. See -ignore-remote-version A rare option used for the remote backend only. See
the remote backend documentation for more information. the remote backend documentation for more information.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
-state, state-out, and -backup are legacy options supported for the local -state, state-out, and -backup are legacy options supported for the local
backend only. For more information, see the local backend's documentation. backend only. For more information, see the local backend's documentation.

View File

@ -82,6 +82,15 @@ Options:
-verbose Print the plan or state for each test run block as it -verbose Print the plan or state for each test run block as it
executes. executes.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
return strings.TrimSpace(helpText) return strings.TrimSpace(helpText)
} }

View File

@ -145,6 +145,15 @@ Usage: tofu [global options] force-unlock LOCK_ID
Options: Options:
-force Don't ask for input for unlock confirmation. -force Don't ask for input for unlock confirmation.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
return strings.TrimSpace(helpText) return strings.TrimSpace(helpText)
} }

View File

@ -233,6 +233,15 @@ Options:
-ignore-remote-version A rare option used for the remote backend only. See -ignore-remote-version A rare option used for the remote backend only. See
the remote backend documentation for more information. the remote backend documentation for more information.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
-state, state-out, and -backup are legacy options supported for the local -state, state-out, and -backup are legacy options supported for the local
backend only. For more information, see the local backend's documentation. backend only. For more information, see the local backend's documentation.

View File

@ -207,6 +207,15 @@ Options:
-test-directory=path Set the OpenTofu test directory, defaults to "tests". When set, the -test-directory=path Set the OpenTofu test directory, defaults to "tests". When set, the
test command will search for test files in the current directory and test command will search for test files in the current directory and
in the one specified by the flag. in the one specified by the flag.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
return strings.TrimSpace(helpText) return strings.TrimSpace(helpText)
} }

View File

@ -235,6 +235,15 @@ Options:
-lock-timeout=0s Duration to retry a state lock. -lock-timeout=0s Duration to retry a state lock.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
return strings.TrimSpace(helpText) return strings.TrimSpace(helpText)
} }

View File

@ -109,6 +109,16 @@ Usage: tofu [global options] workspace list
List OpenTofu workspaces. List OpenTofu workspaces.
Options:
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
return strings.TrimSpace(helpText) return strings.TrimSpace(helpText)
} }

View File

@ -210,6 +210,15 @@ Options:
-state=path Copy an existing state file into the new workspace. -state=path Copy an existing state file into the new workspace.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
return strings.TrimSpace(helpText) return strings.TrimSpace(helpText)
} }

View File

@ -169,6 +169,14 @@ Options:
-or-create=false Create the OpenTofu workspace if it doesn't exist. -or-create=false Create the OpenTofu workspace if it doesn't exist.
-var 'foo=bar' Set a value for one of the input variables in the root
module of the configuration. Use this option more than
once to set more than one variable.
-var-file=filename Load variable values from the given file, in addition
to the default files terraform.tfvars and *.auto.tfvars.
Use this option more than once to include more than one
variables file.
` `
return strings.TrimSpace(helpText) return strings.TrimSpace(helpText)
} }