hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io
Other
43.14k stars 9.58k forks source link

[feature] better bash completion for -target and -options #35618

Open Kamilcuk opened 3 months ago

Kamilcuk commented 3 months ago

Terraform Version

Terraform v1.9.3

Use Cases

The use case is any command typed in the terminal.

Attempted Solutions

No solution has been found. The solution could be parsing terraform files myself and finding the answer.

Proposal

I propose to bash-complete the -option of terraform commang line tool:

$ terraform apply -auto-<TAB>
->
$ terraform apply -auto-approve

Additionally I propose to bash-complete the target names:

$ terraform apply -target=nomad_job.something<TAB>
nomad_job.something_a nomad_job.something_b
$ terraform apply -target=nomad_job.something

References

No response

crw commented 3 months ago

Thanks for this feature request! If you are viewing this issue and would like to indicate your interest, please use the 👍 reaction on the issue description to upvote this issue. We also welcome additional use case descriptions. Thanks again!

(Note: may be related to #28788.)