Skip to content

Commit

Permalink
Link to list of allowed configurations in produce/consume (#2684)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianstrauch authored Mar 14, 2024
1 parent 0e7706f commit 47604c9
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 12 deletions.
6 changes: 6 additions & 0 deletions cmd/lint/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ var flagRules = []linter.FlagRule{
linter.RequireFlagUsageEndWithPunctuation,
linter.ExcludeFlag(
"batch-size",
"config",
"enable-systest-events",
"formatter",
"isolation-level",
Expand Down Expand Up @@ -212,7 +213,10 @@ var vocabWords = []string{
"geo",
"gzip",
"hostname",
"https",
"html",
"iam",
"io",
"ip",
"ips",
"json",
Expand All @@ -227,9 +231,11 @@ var vocabWords = []string{
"ksql",
"ksqldb",
"ktor",
"librdkafka",
"lifecycle",
"lkc",
"lz4",
"md",
"mds",
"netrc",
"nodejs",
Expand Down
2 changes: 1 addition & 1 deletion internal/kafka/command_topic_consume.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (c *command) newConsumeCommand() *cobra.Command {
cmd.Flags().Bool("full-header", false, "Print complete content of message headers.")
cmd.Flags().String("delimiter", "\t", "The delimiter separating each key and value.")
cmd.Flags().Bool("timestamp", false, "Print message timestamp in milliseconds.")
cmd.Flags().StringSlice("config", nil, `A comma-separated list of configuration overrides ("key=value") for the consumer client.`)
cmd.Flags().StringSlice("config", nil, `A comma-separated list of configuration overrides ("key=value") for the consumer client. For a full list, see https://docs.confluent.io/platform/current/clients/librdkafka/html/md_CONFIGURATION.html`)
pcmd.AddConsumerConfigFileFlag(cmd)
cmd.Flags().String("schema-registry-endpoint", "", "Endpoint for Schema Registry cluster.")

Expand Down
2 changes: 1 addition & 1 deletion internal/kafka/command_topic_produce.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (c *command) newProduceCommand() *cobra.Command {
cmd.Flags().String("references", "", "The path to the message value schema references file.")
cmd.Flags().Bool("parse-key", false, "Parse key from the message.")
cmd.Flags().String("delimiter", ":", "The delimiter separating each key and value.")
cmd.Flags().StringSlice("config", nil, `A comma-separated list of configuration overrides ("key=value") for the producer client.`)
cmd.Flags().StringSlice("config", nil, `A comma-separated list of configuration overrides ("key=value") for the producer client. For a full list, see https://docs.confluent.io/platform/current/clients/librdkafka/html/md_CONFIGURATION.html`)
pcmd.AddProducerConfigFileFlag(cmd)
cmd.Flags().String("schema-registry-endpoint", "", "Endpoint for Schema Registry cluster.")

Expand Down
2 changes: 1 addition & 1 deletion internal/local/command_kafka_topic_consume.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (c *command) newKafkaTopicConsumeCommand() *cobra.Command {
cmd.Flags().Bool("print-key", false, "Print key of the message.")
cmd.Flags().Bool("timestamp", false, "Print message timestamp in milliseconds.")
cmd.Flags().String("delimiter", "\t", "The delimiter separating each key and value.")
cmd.Flags().StringSlice("config", nil, `A comma-separated list of configuration overrides ("key=value") for the consumer client.`)
cmd.Flags().StringSlice("config", nil, `A comma-separated list of configuration overrides ("key=value") for the consumer client. For a full list, see https://docs.confluent.io/platform/current/clients/librdkafka/html/md_CONFIGURATION.html`)
pcmd.AddConsumerConfigFileFlag(cmd)

cobra.CheckErr(cmd.MarkFlagFilename("config-file", "avsc", "json"))
Expand Down
2 changes: 1 addition & 1 deletion internal/local/command_kafka_topic_produce.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (c *command) newKafkaTopicProduceCommand() *cobra.Command {

cmd.Flags().Bool("parse-key", false, "Parse key from the message.")
cmd.Flags().String("delimiter", ":", "The delimiter separating each key and value.")
cmd.Flags().StringSlice("config", nil, `A comma-separated list of configuration overrides ("key=value") for the producer client.`)
cmd.Flags().StringSlice("config", nil, `A comma-separated list of configuration overrides ("key=value") for the producer client. For a full list, see https://docs.confluent.io/platform/current/clients/librdkafka/html/md_CONFIGURATION.html`)
pcmd.AddProducerConfigFileFlag(cmd)

cobra.CheckErr(cmd.MarkFlagFilename("config-file", "avsc", "json"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Flags:
--full-header Print complete content of message headers.
--delimiter string The delimiter separating each key and value. (default "\t")
--timestamp Print message timestamp in milliseconds.
--config strings A comma-separated list of configuration overrides ("key=value") for the consumer client.
--config strings A comma-separated list of configuration overrides ("key=value") for the consumer client. For a full list, see https://docs.confluent.io/platform/current/clients/librdkafka/html/md_CONFIGURATION.html
--config-file string The path to the configuration file for the consumer client, in JSON or Avro format.
--schema-registry-endpoint string Endpoint for Schema Registry cluster.
--api-key string API key.
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/output/kafka/topic/consume-help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Flags:
--full-header Print complete content of message headers.
--delimiter string The delimiter separating each key and value. (default "\t")
--timestamp Print message timestamp in milliseconds.
--config strings A comma-separated list of configuration overrides ("key=value") for the consumer client.
--config strings A comma-separated list of configuration overrides ("key=value") for the consumer client. For a full list, see https://docs.confluent.io/platform/current/clients/librdkafka/html/md_CONFIGURATION.html
--config-file string The path to the configuration file for the consumer client, in JSON or Avro format.
--schema-registry-endpoint string Endpoint for Schema Registry cluster.
--api-key string API key.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Flags:
--references string The path to the message value schema references file.
--parse-key Parse key from the message.
--delimiter string The delimiter separating each key and value. (default ":")
--config strings A comma-separated list of configuration overrides ("key=value") for the producer client.
--config strings A comma-separated list of configuration overrides ("key=value") for the producer client. For a full list, see https://docs.confluent.io/platform/current/clients/librdkafka/html/md_CONFIGURATION.html
--config-file string The path to the configuration file for the producer client, in JSON or Avro format.
--schema-registry-endpoint string Endpoint for Schema Registry cluster.
--key-references string The path to the message key schema references file.
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/output/kafka/topic/produce-help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Flags:
--references string The path to the message value schema references file.
--parse-key Parse key from the message.
--delimiter string The delimiter separating each key and value. (default ":")
--config strings A comma-separated list of configuration overrides ("key=value") for the producer client.
--config strings A comma-separated list of configuration overrides ("key=value") for the producer client. For a full list, see https://docs.confluent.io/platform/current/clients/librdkafka/html/md_CONFIGURATION.html
--config-file string The path to the configuration file for the producer client, in JSON or Avro format.
--schema-registry-endpoint string Endpoint for Schema Registry cluster.
--key-references string The path to the message key schema references file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Flags:
--print-key Print key of the message.
--timestamp Print message timestamp in milliseconds.
--delimiter string The delimiter separating each key and value. (default "\t")
--config strings A comma-separated list of configuration overrides ("key=value") for the consumer client.
--config strings A comma-separated list of configuration overrides ("key=value") for the consumer client. For a full list, see https://docs.confluent.io/platform/current/clients/librdkafka/html/md_CONFIGURATION.html
--config-file string The path to the configuration file for the consumer client, in JSON or Avro format.

Global Flags:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/output/local/kafka/topic/consume-help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Flags:
--print-key Print key of the message.
--timestamp Print message timestamp in milliseconds.
--delimiter string The delimiter separating each key and value. (default "\t")
--config strings A comma-separated list of configuration overrides ("key=value") for the consumer client.
--config strings A comma-separated list of configuration overrides ("key=value") for the consumer client. For a full list, see https://docs.confluent.io/platform/current/clients/librdkafka/html/md_CONFIGURATION.html
--config-file string The path to the configuration file for the consumer client, in JSON or Avro format.

Global Flags:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Produce message to topic "test" providing key.
Flags:
--parse-key Parse key from the message.
--delimiter string The delimiter separating each key and value. (default ":")
--config strings A comma-separated list of configuration overrides ("key=value") for the producer client.
--config strings A comma-separated list of configuration overrides ("key=value") for the producer client. For a full list, see https://docs.confluent.io/platform/current/clients/librdkafka/html/md_CONFIGURATION.html
--config-file string The path to the configuration file for the producer client, in JSON or Avro format.

Global Flags:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/output/local/kafka/topic/produce-help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Produce message to topic "test" providing key.
Flags:
--parse-key Parse key from the message.
--delimiter string The delimiter separating each key and value. (default ":")
--config strings A comma-separated list of configuration overrides ("key=value") for the producer client.
--config strings A comma-separated list of configuration overrides ("key=value") for the producer client. For a full list, see https://docs.confluent.io/platform/current/clients/librdkafka/html/md_CONFIGURATION.html
--config-file string The path to the configuration file for the producer client, in JSON or Avro format.

Global Flags:
Expand Down

0 comments on commit 47604c9

Please sign in to comment.