hashicorp / terraform-exec

Terraform CLI commands via Go.
https://pkg.go.dev/github.com/hashicorp/terraform-exec
Mozilla Public License 2.0
687 stars 115 forks source link

Feature request: Add option to disable `-no-color` flag #264

Open agileman-droid opened 2 years ago

agileman-droid commented 2 years ago

Hi guys,

we were wondering if it is possible to enable colored output for the Terraform commands.

We are interested in a colored output of the Terraform plan (in ShowPlanFileRaw). However, the showCmd function automatically adds the -no-color flag. It would be nice if the -no-color flag could be optionally disabled, resulting in colored command output.

Thanks in advance!

digitalkaoz commented 2 years ago

Would be interested in a -color flag too

kmoe commented 2 years ago

Interesting. What is your use case for this?

agileman-droid commented 2 years ago

We are building a custom infrastructure tool which integrates terraform-exec. So for nicer usability and look and feel, we would like colored Terraform output in this tool.

digitalkaoz commented 2 years ago

@kmoe we are building a tool which wraps terraform to load var files or configure backends be conventions:

https://github.com/terrarium-tf/cli

so a colored output just makes things a little bit more "native"

stobias123 commented 2 years ago

bump - would love this feature.

Rulox commented 2 years ago

+1

I don't understand why the --no-color is hardcoded there, it should be an option.

digitalkaoz commented 2 years ago

the PR was ready months ago...

rr-krupesh-savaliya commented 1 year ago

Can we resolve this asap?

ishaankalra commented 3 months ago

Any reason why the PR is not merged yet?