From 1198e5b02d6c36000393dd91cda5a6060fa87091 Mon Sep 17 00:00:00 2001 From: Luis Silva Date: Mon, 30 Jul 2018 08:21:00 +0100 Subject: [PATCH] Improve argument parsing formatting --- plugin.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/plugin.go b/plugin.go index dcd241d..2d33629 100644 --- a/plugin.go +++ b/plugin.go @@ -256,11 +256,10 @@ func tfDestroy(config Config) *exec.Cmd { args = append(args, fmt.Sprintf("-target=%s", v)) } for _, v := range config.VarFiles { - args = append(args, "-var-file", fmt.Sprintf("%s", v)) + args = append(args, fmt.Sprintf("-var-file=%s", v)) } for k, v := range config.Vars { - args = append(args, "-var") - args = append(args, fmt.Sprintf("%s=%s", k, v)) + args = append(args, "-var", fmt.Sprintf("%s=%s", k, v)) } if config.Parallelism > 0 { args = append(args, fmt.Sprintf("-parallelism=%d", config.Parallelism)) @@ -293,11 +292,10 @@ func tfPlan(config Config, destroy bool) *exec.Cmd { args = append(args, "--target", fmt.Sprintf("%s", v)) } for _, v := range config.VarFiles { - args = append(args, "-var-file", fmt.Sprintf("%s", v)) + args = append(args, fmt.Sprintf("-var-file=%s", v)) } for k, v := range config.Vars { - args = append(args, "-var") - args = append(args, fmt.Sprintf("%s=%s", k, v)) + args = append(args, "-var", fmt.Sprintf("%s=%s", k, v)) } if config.Parallelism > 0 { args = append(args, fmt.Sprintf("-parallelism=%d", config.Parallelism)) @@ -319,11 +317,10 @@ func tfValidate(config Config) *exec.Cmd { "validate", } for _, v := range config.VarFiles { - args = append(args, "-var-file", fmt.Sprintf("%s", v)) + args = append(args, fmt.Sprintf("-var-file=%s", v)) } for k, v := range config.Vars { - args = append(args, "-var") - args = append(args, fmt.Sprintf("%s=%s", k, v)) + args = append(args, "-var", fmt.Sprintf("%s=%s", k, v)) } return exec.Command( "terraform",