66from saluki .listen import listen
77from saluki .play import play
88from saluki .sniff import sniff
9- from saluki .utils import parse_kafka_uri , dateutil_parsable_or_unix_timestamp
9+ from saluki .utils import dateutil_parsable_or_unix_timestamp , parse_kafka_uri
1010
1111logger = logging .getLogger ("saluki" )
1212logging .basicConfig (level = logging .INFO )
@@ -23,7 +23,7 @@ def main() -> None:
2323 description = "serialise/de-serialise flatbuffers and consume/produce from/to kafka" ,
2424 )
2525 common_options = argparse .ArgumentParser (add_help = False )
26- common_options .add_argument ("-v" , "--verbose" , help = "show DEBUG logs" , action = ' store_true' )
26+ common_options .add_argument ("-v" , "--verbose" , help = "show DEBUG logs" , action = " store_true" )
2727 common_options .add_argument (
2828 "-l" ,
2929 "--log-file" ,
@@ -48,8 +48,12 @@ def main() -> None:
4848
4949 sub_parsers = parser .add_subparsers (help = "sub-command help" , required = True , dest = "command" )
5050
51- sniff_parser = sub_parsers .add_parser (_SNIFF , help = "sniff - broker metadata" , parents = [common_options ])
52- sniff_parser .add_argument ("broker" , type = str , help = "broker, optionally suffixed with a topic name to filter to" )
51+ sniff_parser = sub_parsers .add_parser (
52+ _SNIFF , help = "sniff - broker metadata" , parents = [common_options ]
53+ )
54+ sniff_parser .add_argument (
55+ "broker" , type = str , help = "broker, optionally suffixed with a topic name to filter to"
56+ )
5357
5458 consumer_parser = argparse .ArgumentParser (add_help = False )
5559 consumer_parser .add_argument (
@@ -75,9 +79,17 @@ def main() -> None:
7579 consumer_mode_parser .add_argument ("-g" , "--go-forwards" , required = False , action = "store_true" )
7680 cg = consumer_mode_parser .add_mutually_exclusive_group (required = False )
7781 cg .add_argument (
78- "-o" , "--offset" , help = "offset to consume from" , type = int ,
82+ "-o" ,
83+ "--offset" ,
84+ help = "offset to consume from" ,
85+ type = int ,
86+ )
87+ cg .add_argument (
88+ "-t" ,
89+ "--timestamp" ,
90+ help = "timestamp to consume from" ,
91+ type = dateutil_parsable_or_unix_timestamp ,
7992 )
80- cg .add_argument ("-t" , "--timestamp" , help = "timestamp to consume from" , type = dateutil_parsable_or_unix_timestamp )
8193
8294 listen_parser = sub_parsers .add_parser ( # noqa: F841
8395 _LISTEN ,
@@ -99,7 +111,14 @@ def main() -> None:
99111 type = int ,
100112 nargs = 2 ,
101113 )
102- g .add_argument ("-t" , "--timestamps" , help = 'timestamps to replay between in ISO8601 or RFC3339 format ie. "2025-11-17 07:00:00 or as a unix timestamp" ' , type = dateutil_parsable_or_unix_timestamp , nargs = 2 )
114+ g .add_argument (
115+ "-t" ,
116+ "--timestamps" ,
117+ help = "timestamps to replay between in ISO8601 or RFC3339 format ie."
118+ ' "2025-11-17 07:00:00 or as a unix timestamp" ' ,
119+ type = dateutil_parsable_or_unix_timestamp ,
120+ nargs = 2 ,
121+ )
103122
104123 if len (sys .argv ) == 1 :
105124 parser .print_help ()
@@ -121,7 +140,14 @@ def main() -> None:
121140 elif args .command == _CONSUME :
122141 broker , topic = parse_kafka_uri (args .topic )
123142 consume (
124- broker , topic , args .partition , args .messages , args .offset , args .go_forwards , args .filter , args .timestamp
143+ broker ,
144+ topic ,
145+ args .partition ,
146+ args .messages ,
147+ args .offset ,
148+ args .go_forwards ,
149+ args .filter ,
150+ args .timestamp ,
125151 )
126152 elif args .command == _PLAY :
127153 src_broker , src_topic = parse_kafka_uri (args .topics [0 ])
0 commit comments