Technoboy- commented on code in PR #21664:
URL: https://github.com/apache/pulsar/pull/21664#discussion_r1413789438


##########
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java:
##########
@@ -726,10 +734,38 @@ private class DeleteCmd extends CliCommand {
                 + "but the parameter is invalid and the schema is always 
deleted", hidden = true)
         private boolean deleteSchema = false;
 
+        @Parameter(names = {"-r", "regex"},
+                description = "Use a regex expression to match multiple topics 
for deletion.")
+        boolean regex = false;
+
+        @Parameter(names = {"--from-file"}, description = "Read a list of 
topics from a file for deletion.")
+        boolean readFromFile;
+
+
         @Override
-        void run() throws PulsarAdminException {
-            String topic = validateTopicName(params);
-            getTopics().delete(topic, force);
+        void run() throws PulsarAdminException, IOException {
+            if (readFromFile && regex) {
+                throw new ParameterException("Could not apply regex when read 
topics from file.");
+            }
+            if (readFromFile) {
+                String path = checkArgument(params);
+                List<String> topicsFromFile = 
Files.readAllLines(Path.of(path));
+                for (String t : topicsFromFile) {
+                    getTopics().delete(t);

Review Comment:
   Why not `force`?



-- 
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