Skip to content

Commit

Permalink
Update state mv help docs to use spaces instead of tabs
Browse files Browse the repository at this point in the history
Adds a test to make sure that this text doesn't accidentally
get tabs added, without having a test that simply direct matches
the whole strings (which would be brittle to adding a tab to the
test validation)
  • Loading branch information
pselle committed Jan 26, 2021
1 parent c066127 commit 35d5ea5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
22 changes: 11 additions & 11 deletions command/state_mv.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,27 +469,27 @@ Options:
actually move anything.
-backup=PATH Path where Terraform should write the backup for the
original state. This can't be disabled. If not set,
Terraform will write it to the same path as the
statefile with a ".backup" extension.
original state. This can't be disabled. If not set,
Terraform will write it to the same path as the
statefile with a ".backup" extension.
-backup-out=PATH Path where Terraform should write the backup for the
destination state. This can't be disabled. If not
set, Terraform will write it to the same path as the
destination state file with a backup extension. This
only needs to be specified if -state-out is set to a
different path than -state.
destination state. This can't be disabled. If not
set, Terraform will write it to the same path as the
destination state file with a backup extension. This
only needs to be specified if -state-out is set to a
different path than -state.
-lock=true Lock the state files when locking is supported.
-lock-timeout=0s Duration to retry a state lock.
-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
this isn't specified, the source state file will be
used. This can be a new or existing path.
this isn't specified, the source state file will be
used. This can be a new or existing path.
-ignore-remote-version Continue even if remote and local Terraform versions
differ. This may result in an unusable workspace, and
Expand Down
7 changes: 7 additions & 0 deletions command/state_mv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,13 @@ func TestStateMv_onlyResourceInModule(t *testing.T) {
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 = `
test_instance.baz:
ID = foo
Expand Down

0 comments on commit 35d5ea5

Please sign in to comment.