Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: Improved error for invalid -var "foo = bar"
When specifying variable values on the command line, name-value pairs must be joined with an equals sign, without surrounding spaces. Previously Terraform would interpret "foo = bar" as assigning the value " bar" to the variable named "foo ". This is never valid, as variable names may not include whitespace. This commit looks for this specific error and returns a diagnostic with a suggestion for correcting it. We cannot simply trim whitespace, because it is valid to write "foo= bar" to assign the value " bar" to the variable "foo", as unlikely as it seems.
- Loading branch information
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters