Skip to content

Commit 25006d4

Browse files
committed
fix(cli): Deprecate color flag
1 parent 2a9943b commit 25006d4

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

cli/cmd/root.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ Find more information at:
3131
func NewCmdRoot() *cobra.Command {
3232
logLevel := enum.NewEnum([]string{"trace", "debug", "info", "warn", "error"}, "info")
3333
logFormat := enum.NewEnum([]string{"text", "json"}, "text")
34-
noColor := false
3534
logConsole := false
3635
noLogFile := false
3736
logFileName := "cloudquery.log"
@@ -79,7 +78,7 @@ func NewCmdRoot() *cobra.Command {
7978
if logFormat.String() == "text" {
8079
writers = append(writers, zerolog.ConsoleWriter{
8180
Out: os.Stderr,
82-
NoColor: noColor,
81+
NoColor: true,
8382
FormatTimestamp: formatTimestampUtcRfc3339,
8483
})
8584
} else {
@@ -110,6 +109,7 @@ func NewCmdRoot() *cobra.Command {
110109
return err
111110
}
112111
}
112+
113113
return nil
114114
},
115115
PersistentPostRun: func(cmd *cobra.Command, args []string) {
@@ -121,7 +121,11 @@ func NewCmdRoot() *cobra.Command {
121121

122122
cmd.PersistentFlags().String("data-dir", "./.cq", "set persistent data directory (env: CQ_DATA_DIR)")
123123

124-
cmd.PersistentFlags().String("color", "auto", "Enable colorized output (on, off, auto)")
124+
cmd.PersistentFlags().String("color", "auto", "Enable colorized output when log-console is set (on, off, auto)")
125+
err := cmd.PersistentFlags().MarkDeprecated("color", "console logs are always colorless")
126+
if err != nil {
127+
panic(err)
128+
}
125129

126130
// Logging Flags
127131
cmd.PersistentFlags().BoolVar(&logConsole, "log-console", false, "enable console logging")

website/pages/docs/reference/cli/cloudquery.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Find more information at:
1717
### Options
1818

1919
```
20-
--color string Enable colorized output (on, off, auto) (default "auto")
2120
--data-dir string set persistent data directory (env: CQ_DATA_DIR) (default "./.cq")
2221
-h, --help help for cloudquery
2322
--log-console enable console logging

website/pages/docs/reference/cli/cloudquery_sync.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ cloudquery sync ./directory ./aws.yml ./pg.yml
3232
### Options inherited from parent commands
3333

3434
```
35-
--color string Enable colorized output (on, off, auto) (default "auto")
3635
--data-dir string set persistent data directory (env: CQ_DATA_DIR) (default "./.cq")
3736
--log-console enable console logging
3837
--log-file-name string Log filename (default "cloudquery.log")

0 commit comments

Comments
 (0)