Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New flag: no-color #52

Merged
merged 2 commits into from
Mar 17, 2022
Merged

New flag: no-color #52

merged 2 commits into from
Mar 17, 2022

Conversation

magodo
Copy link
Contributor

@magodo magodo commented Mar 2, 2022

Support no-color flag to suppress colorful output. This is useful when combining terrafmt with other tools via pipe. My use case is to combine terrafmt blocks together with https://github.com/magodo/hclgrep to filter certain pattern among acctests.

cli/cmds.go Outdated
@@ -227,6 +227,7 @@ func Make() *cobra.Command {
pflags.BoolP("check", "c", false, "return an error during diff if formatting is required")
pflags.BoolP("verbose", "v", false, "show files as they are processed& additional stats")
pflags.BoolP("quiet", "q", false, "quiet mode, only shows block line numbers ")
pflags.BoolP("no-color", "C", false, "disable colorful output")
Copy link
Owner

@katbyte katbyte Mar 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we change this to

Suggested change
pflags.BoolP("no-color", "C", false, "disable colorful output")
pflags.BoolP("uncoloured", "u", false, "disable coloured output")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@katbyte Sure, made the change.

Copy link
Owner

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @magodo - LGTM 🚀

@katbyte katbyte added this to the v0.3.0 milestone Mar 17, 2022
@katbyte katbyte merged commit 56d442f into katbyte:main Mar 17, 2022
@katbyte katbyte modified the milestones: v0.3.0, v0.4.0 Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants