Commit graph

15 commits

Author SHA1 Message Date
Sarah French
9595517730
Update test for autocompletion of top-level commands (#37853)
Some checks failed
build / Build for freebsd_amd64 (push) Has been cancelled
build / Build for linux_amd64 (push) Has been cancelled
build / Build for openbsd_amd64 (push) Has been cancelled
build / Build for solaris_amd64 (push) Has been cancelled
build / Build for windows_amd64 (push) Has been cancelled
build / Build for freebsd_arm (push) Has been cancelled
build / Build for linux_arm (push) Has been cancelled
build / Build for darwin_arm64 (push) Has been cancelled
build / Build for linux_arm64 (push) Has been cancelled
build / Build for windows_arm64 (push) Has been cancelled
build / Build Docker image for linux_386 (push) Has been cancelled
build / Build Docker image for linux_amd64 (push) Has been cancelled
build / Build Docker image for linux_arm (push) Has been cancelled
build / Build Docker image for linux_arm64 (push) Has been cancelled
build / Build e2etest for linux_386 (push) Has been cancelled
build / Build e2etest for windows_386 (push) Has been cancelled
build / Build e2etest for darwin_amd64 (push) Has been cancelled
build / Build e2etest for linux_amd64 (push) Has been cancelled
build / Build e2etest for windows_amd64 (push) Has been cancelled
build / Build e2etest for linux_arm (push) Has been cancelled
build / Build e2etest for darwin_arm64 (push) Has been cancelled
build / Build e2etest for linux_arm64 (push) Has been cancelled
build / Run e2e test for linux_386 (push) Has been cancelled
build / Run e2e test for windows_386 (push) Has been cancelled
build / Run e2e test for darwin_amd64 (push) Has been cancelled
build / Run e2e test for linux_amd64 (push) Has been cancelled
build / Run e2e test for windows_amd64 (push) Has been cancelled
build / Run e2e test for linux_arm (push) Has been cancelled
build / Run e2e test for linux_arm64 (push) Has been cancelled
build / Run terraform-exec test for linux amd64 (push) Has been cancelled
* 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
2025-11-05 11:24:29 +00:00
Martin Atkins
48df3121af go.mod: go get github.com/mattn/go-shellwords@v1.0.12
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.
2024-03-13 12:41:47 -07:00
Jamie Finnigan
05b0bdac99
adopt hashicorp/cli fork of mitchellh/cli (#34429) 2023-12-20 11:04:10 +00:00
hashicorp-copywrite[bot]
53c34ff49c
Update copyright file headers to BUSL-1.1 2023-08-10 23:43:27 +01:00
kmoe
d1a5dfa1ad
command: test plan -refresh= arg ordering (#33483)
* 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.
2023-07-06 19:28:09 +01:00
hashicorp-copywrite[bot]
325d18262e [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
James Bardin
622c4df14c remove the use of panicwrap
Stop using panicwrap, and execute terraform in the main process.
2021-10-28 11:51:39 -04:00
James Bardin
270ab97418 don't error when processing autocomplete commands
The shell autocomplete command will use the binary name as the first
argument which does not show up under the list of subcommands.
2021-03-31 13:28:08 -04:00
Jonathan Hall
49ee3d3ef8 Grammar nit: "setup" as a verb should be spelled "set up" 2021-01-26 20:39:11 +01:00
James Bardin
0c3bb316ea redirect warnigns to stdout
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.
2020-11-30 12:29:44 -05:00
Martin Atkins
3f401f0cd4 main: make configuration available when initializing commands
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.
2017-09-29 14:03:09 -07:00
Mitchell Hashimoto
518ae5ef02
support nested subcommands with TF_CLI_ARGS 2017-02-13 15:18:50 -08:00
Mitchell Hashimoto
df93e5120c
allow targeted TF_CLI_ARGS_x 2017-02-13 15:12:29 -08:00
Mitchell Hashimoto
53796fcdb0
test for blank args for TF_CLI_ARGS 2017-02-13 14:53:50 -08:00
Mitchell Hashimoto
7f67b32169
main: add TF_CLI_ARGS to specify additional CLI args 2017-02-13 14:05:37 -08:00