You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: cmd/kaf/consume.go
+26-4
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@ package main
2
2
3
3
import (
4
4
"fmt"
5
+
"os"
5
6
"sync"
6
7
7
8
"github.com/birdayz/sarama"
@@ -11,13 +12,15 @@ import (
11
12
12
13
var (
13
14
offsetFlagstring
14
-
prettyPrintbool
15
+
rawbool
16
+
followbool
15
17
)
16
18
17
19
funcinit() {
18
20
rootCmd.AddCommand(consumeCmd)
19
21
consumeCmd.Flags().StringVar(&offsetFlag, "offset", "oldest", "Offset to start consuming. Possible values: oldest, newest. Default: newest")
20
-
consumeCmd.Flags().BoolVar(&prettyPrint, "pretty", false, "Pretty print output if possible, e.g. for JSON.")
22
+
consumeCmd.Flags().BoolVar(&raw, "raw", false, "Print raw output of messages, without key or prettified JSON")
23
+
consumeCmd.Flags().BoolVarP(&follow, "follow", "f", false, "Shorthand to start consuming with offset HEAD-1 on each partition. Overrides --offset flag")
21
24
}
22
25
23
26
varconsumeCmd=&cobra.Command{
@@ -61,6 +64,25 @@ var consumeCmd = &cobra.Command{
0 commit comments