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
42.56k stars 9.53k forks source link

Make cli options 'json' and 'no-color' global options #33719

Open AdamCoulterOz opened 1 year ago

AdamCoulterOz commented 1 year ago

Terraform Version

Terraform v1.5.5
on darwin_arm64

Use Cases

Working with the cli programmatically, some commands accept these options, others don't, and it seems somewhat arbitrary.

Attempted Solutions

Mapping to every command individually, but have to maintain if each command supports it or not.

Proposal

Make the terraform cli options 'json' and 'no-color' global options (i.e. before the subcommand).

References

No response

crw commented 1 year ago

Thanks for this request! It appears to be a duplicate of https://github.com/hashicorp/terraform/issues/23708. If you agree, I will close this issue. Please let me know! Thanks.

AdamCoulterOz commented 1 year ago

@crw - yes for no-color, but for a different reason, but #23708 doesn't include a global json option.