* Update test for autocompletion of top-level commands
* Add test coverage for autocompletion of workspace names in `workspace select` subcommand
* Remove autocompletion tests for workspace select
We use this library only for interpreting the "TF_CLI_ARG_..." environment
variables as additional command line arguments, so the potential impact
of this is very limited.
The upstream changes here expand on the supported dynamic behavior around
backtick command execution and nested environment variable expansion. We
don't use either of those features, but just to make sure I changed the
code to force them off (since otherwise another package in the program
could change the package's global configuration) and added test cases that
will fail if they end up turned on.
* main: disambiguate arg ordering test
Make it extra clear what order of args we are asserting.
* command: fix plan -refresh=false test
The test for plan -refresh=false was not functioning, since ReadResource will not be called if the resource is not in prior state.
Add a new fixture directory with state, and also test the converse, to prevent regression.
* command: add test for refresh flag precedence
A consumer relies on the fact that running terraform plan -refresh=false -refresh true gives the same result as terraform plan -refresh=true.
The default cli Warn calls always write to the error writer (stderr by
default), however the output is intended to be viewed in the UI by the
user, rather than in a separate stream. Terraform also generally does
not consider warnings to be errors from the cli point of view, and does
not need to output the warning text to stderr.
By redirecting Warn calls to Output calls at the lowest level in the
main package, we can eliminate the chance that Warn and Output
messages are interleaved, while still allowing the internal `cli.Ui`
implementations to format `Warn` and `Output` calls separately.
This, in principle, allows us to make use of configuration information
when we populate the Meta structure, though we won't actually make use
of that until a subsequent commit.