File tree Expand file tree Collapse file tree 5 files changed +14
-5
lines changed
cmd/kafka/consumergroup/describe Expand file tree Collapse file tree 5 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 11[
22 {
3- "id " : " consumer_group_1" ,
3+ "groupId " : " consumer_group_1" ,
44 "consumers" : [
55 {
66 "groupId" : " consumer_group_1" ,
2323 ]
2424 },
2525 {
26- "id " : " consumer_group_2" ,
26+ "groupId " : " consumer_group_2" ,
2727 "consumers" : [
2828 {
2929 "groupId" : " consumer_group_2" ,
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ module.exports = {
139139} ;
140140
141141function getConsumerGroup ( id ) {
142- return consumerGroups . find ( c => c . id === id ) ;
142+ return consumerGroups . find ( c => c . groupId === id ) ;
143143}
144144
145145function getTopic ( name ) {
Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ func mapConsumerGroupDescribeToTableFormat(consumers []strimziadminclient.Consum
197197 return rows
198198}
199199
200+ // print the consumer grooup details
200201func printConsumerGroupDetails (w io.Writer , consumerGroupData strimziadminclient.ConsumerGroup ) {
201202 fmt .Fprintln (w , "" )
202203 consumers := consumerGroupData .GetConsumers ()
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package color
33
44import (
55 "fmt"
6+ "runtime"
67
78 "github.com/fatih/color"
89)
@@ -27,6 +28,12 @@ func Error(format string) string {
2728 return color .HiRedString (format )
2829}
2930
31+ // Bold makes a string bold
3032func Bold (s string ) string {
33+ // do not bold the string if the current OS is Windows
34+ // Command Prompt does not support ANSI escape characters
35+ if runtime .GOOS == "windows" {
36+ return s
37+ }
3138 return fmt .Sprintf ("\033 [1m%v\033 [0m" , s )
3239}
Original file line number Diff line number Diff line change 44 "io"
55 "os"
66
7+ "github.com/fatih/color"
78 "github.com/mattn/go-isatty"
89)
910
@@ -92,8 +93,8 @@ func System() *IOStreams {
9293 io := & IOStreams {
9394 In : os .Stdin ,
9495 originalOut : os .Stdout ,
95- Out : os . Stdout ,
96- ErrOut : os . Stderr ,
96+ Out : color . Output ,
97+ ErrOut : color . Error ,
9798 }
9899
99100 // prevent duplicate isTerminal queries now that we know the answer
You can’t perform that action at this time.
0 commit comments