Skip to content

fix(cli): Deprecate color flag#2812

Merged
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
erezrokah:fix/color_flag
Oct 16, 2022
Merged

fix(cli): Deprecate color flag#2812
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
erezrokah:fix/color_flag

Conversation

@erezrokah
Copy link
Copy Markdown
Member

Summary

Related to #2644.
Since the default is to have log color, it makes sense to have a --no-color flag instead of --color. I added one in a backwards compatible way. Also I think auto never really worked.

cli/cmd/root.go Outdated
return err
}
if noColor {
cmd.MarkFlagRequired("log-console")
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If someone tries to only use --no-color they'll get an error that they need to pass --log-console too, as --no-color doesn't do anything without it

### Options

```
--color string Enable colorized output (on, off, auto) (default "auto")
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Since we marked the flag as deprecated it's removed from the help, but still works

Copy link
Copy Markdown
Contributor

@yevgenypats yevgenypats left a comment

Choose a reason for hiding this comment

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

Giving it a bit more thought, I think we need to skip color all together and only do without colors.

ELT workloads produces tons of logs so no one is really going through them through the terminal.
By disabling color by default I think we will insure the correct behaviour out of the box and prevent confusion and more flags.

I think our CLI is more of very slim worker rather then a UI or something like this so I think it makes sense to avoid colors completely, which causes issues in production environments. wdyt ?

@erezrokah erezrokah changed the title fix(cli): Add flag to disable log console color fix(cli): Deprecate color flag Oct 16, 2022
@erezrokah
Copy link
Copy Markdown
Member Author

erezrokah commented Oct 16, 2022

Giving it a bit more thought, I think we need to skip color all together and only do without colors.

ELT workloads produces tons of logs so no one is really going through them through the terminal. By disabling color by default I think we will insure the correct behaviour out of the box and prevent confusion and more flags.

I think our CLI is more of very slim worker rather then a UI or something like this so I think it makes sense to avoid colors completely, which causes issues in production environments. wdyt ?

Good point, I kept the deprecation with a message that console logs are always colorless, see 25006d4

@kodiakhq kodiakhq bot merged commit 9565195 into cloudquery:main Oct 16, 2022
kodiakhq bot pushed a commit that referenced this pull request Oct 16, 2022
🤖 I have created a release *beep* *boop*
---


## [1.1.5](cli-v1.1.4...cli-v1.1.5) (2022-10-16)


### Bug Fixes

* **cli:** Deprecate color flag ([#2812](#2812)) ([9565195](9565195))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
@erezrokah erezrokah deleted the fix/color_flag branch December 15, 2023 10:13
murarustefaan added a commit that referenced this pull request Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants