Merge pull request #27597 from hashicorp/pselle/state-cli-docs

Update state mv help docs to use spaces instead of tabs
This commit is contained in:
Pam Selle 2021-01-26 11:47:14 -05:00 committed by GitHub
commit 5682f55908
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 11 deletions

View File

@ -469,27 +469,27 @@ Options:
actually move anything. actually move anything.
-backup=PATH Path where Terraform should write the backup for the -backup=PATH Path where Terraform should write the backup for the
original state. This can't be disabled. If not set, original state. This can't be disabled. If not set,
Terraform will write it to the same path as the Terraform will write it to the same path as the
statefile with a ".backup" extension. statefile with a ".backup" extension.
-backup-out=PATH Path where Terraform should write the backup for the -backup-out=PATH Path where Terraform should write the backup for the
destination state. This can't be disabled. If not destination state. This can't be disabled. If not
set, Terraform will write it to the same path as the set, Terraform will write it to the same path as the
destination state file with a backup extension. This destination state file with a backup extension. This
only needs to be specified if -state-out is set to a only needs to be specified if -state-out is set to a
different path than -state. different path than -state.
-lock=true Lock the state files when locking is supported. -lock=true Lock the state files when locking is supported.
-lock-timeout=0s Duration to retry a state lock. -lock-timeout=0s Duration to retry a state lock.
-state=PATH Path to the source state file. Defaults to the -state=PATH Path to the source state file. Defaults to the
configured backend, or "terraform.tfstate" configured backend, or "terraform.tfstate"
-state-out=PATH Path to the destination state file to write to. If -state-out=PATH Path to the destination state file to write to. If
this isn't specified, the source state file will be this isn't specified, the source state file will be
used. This can be a new or existing path. used. This can be a new or existing path.
-ignore-remote-version Continue even if remote and local Terraform versions -ignore-remote-version Continue even if remote and local Terraform versions
differ. This may result in an unusable workspace, and differ. This may result in an unusable workspace, and

View File

@ -1317,6 +1317,13 @@ func TestStateMv_onlyResourceInModule(t *testing.T) {
testStateOutput(t, backups[0], testStateMvOnlyResourceInModule_original) testStateOutput(t, backups[0], testStateMvOnlyResourceInModule_original)
} }
func TestStateMvHelp(t *testing.T) {
c := &StateMvCommand{}
if strings.ContainsRune(c.Help(), '\t') {
t.Fatal("help text contains tab character, which will result in poor formatting")
}
}
const testStateMvOutputOriginal = ` const testStateMvOutputOriginal = `
test_instance.baz: test_instance.baz:
ID = foo ID = foo