mirror of
https://github.com/hashicorp/terraform.git
synced 2026-02-18 18:29:44 -05:00
don't explicitly specify defaults in argument parsing
This commit is contained in:
parent
89bea5de5b
commit
32fb18572d
2 changed files with 7 additions and 17 deletions
|
|
@ -41,9 +41,7 @@ type StateRm struct {
|
|||
// representing the best effort interpretation of the arguments.
|
||||
func ParseStateRm(args []string) (*StateRm, tfdiags.Diagnostics) {
|
||||
var diags tfdiags.Diagnostics
|
||||
rm := &StateRm{
|
||||
StateLock: true,
|
||||
}
|
||||
rm := &StateRm{}
|
||||
|
||||
cmdFlags := defaultFlagSet("state rm")
|
||||
cmdFlags.BoolVar(&rm.DryRun, "dry-run", false, "dry run")
|
||||
|
|
|
|||
|
|
@ -18,25 +18,17 @@ func TestParseStateRm_valid(t *testing.T) {
|
|||
"single address": {
|
||||
[]string{"test_instance.foo"},
|
||||
&StateRm{
|
||||
DryRun: false,
|
||||
BackupPath: "-",
|
||||
StateLock: true,
|
||||
StateLockTimeout: 0,
|
||||
StatePath: "",
|
||||
IgnoreRemoteVersion: false,
|
||||
Addrs: []string{"test_instance.foo"},
|
||||
BackupPath: "-",
|
||||
StateLock: true,
|
||||
Addrs: []string{"test_instance.foo"},
|
||||
},
|
||||
},
|
||||
"multiple addresses": {
|
||||
[]string{"test_instance.foo", "test_instance.bar"},
|
||||
&StateRm{
|
||||
DryRun: false,
|
||||
BackupPath: "-",
|
||||
StateLock: true,
|
||||
StateLockTimeout: 0,
|
||||
StatePath: "",
|
||||
IgnoreRemoteVersion: false,
|
||||
Addrs: []string{"test_instance.foo", "test_instance.bar"},
|
||||
BackupPath: "-",
|
||||
StateLock: true,
|
||||
Addrs: []string{"test_instance.foo", "test_instance.bar"},
|
||||
},
|
||||
},
|
||||
"all options": {
|
||||
|
|
|
|||
Loading…
Reference in a new issue