chia7712 commented on code in PR #20865:
URL: https://github.com/apache/kafka/pull/20865#discussion_r2520461405


##########
tools/src/main/java/org/apache/kafka/tools/TopicCommand.java:
##########
@@ -751,8 +751,7 @@ public TopicCommandOptions(String[] args) {
                     KAFKA_CONFIGS_CLI_SUPPORTS_ALTERING_TOPIC_CONFIGS);
             describeOpt = parser.accepts("describe", "List details for the 
given topics.");
             topicOpt = parser.accepts("topic", "The topic to create, alter, 
describe or delete. It also accepts a regular " +
-                            "expression, except for --create option. Put topic 
name in double quotes and use the '\\' prefix " +
-                            "to escape regular expression symbols; e.g. 
\"test\\.topic\".")
+                            "expression, except for --create option. Put topic 
name in double quotes; e.g. \"test.*\".")

Review Comment:
   The double quotes serve a purpose when the dot is part of topic name. see 
following example:
   ```
   chia7712@fedora:~/project/kafka$ ./bin/kafka-topics.sh --describe 
--bootstrap-server localhost:20000 --topic "chia.7712"
   Topic: chia-7712     TopicId: KgEKT6c1RwOwAn6tTNezow PartitionCount: 1       
ReplicationFactor: 1    Configs: min.insync.replicas=1
        Topic: chia-7712        Partition: 0    Leader: 10513   Replicas: 10513 
Isr: 10513      Elr:    LastKnownElr: 
   Topic: chia.7712     TopicId: 0cczIUZwQ1uEKgtjP93SPg PartitionCount: 1       
ReplicationFactor: 1    Configs: min.insync.replicas=1
        Topic: chia.7712        Partition: 0    Leader: 10513   Replicas: 10513 
Isr: 10513      Elr:    LastKnownElr: 
   
   chia7712@fedora:~/project/kafka$ ./bin/kafka-topics.sh --describe 
--bootstrap-server localhost:20000 --topic "chia\.7712"
   Topic: chia.7712     TopicId: 0cczIUZwQ1uEKgtjP93SPg PartitionCount: 1       
ReplicationFactor: 1    Configs: min.insync.replicas=1
        Topic: chia.7712        Partition: 0    Leader: 10513   Replicas: 10513 
Isr: 10513      Elr:    LastKnownElr: 
   
   chia7712@fedora:~/project/kafka$ ./bin/kafka-topics.sh --describe 
--bootstrap-server localhost:20000 --topic chia\.7712
   Topic: chia-7712     TopicId: KgEKT6c1RwOwAn6tTNezow PartitionCount: 1       
ReplicationFactor: 1    Configs: min.insync.replicas=1
        Topic: chia-7712        Partition: 0    Leader: 10513   Replicas: 10513 
Isr: 10513      Elr:    LastKnownElr: 
   Topic: chia.7712     TopicId: 0cczIUZwQ1uEKgtjP93SPg PartitionCount: 1       
ReplicationFactor: 1    Configs: min.insync.replicas=1
        Topic: chia.7712        Partition: 0    Leader: 10513   Replicas: 10513 
Isr: 10513      Elr:    LastKnownElr: 
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to