anton-vinogradov commented on a change in pull request #9779:
URL: https://github.com/apache/ignite/pull/9779#discussion_r795701119



##########
File path: 
modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/consistency/ConsistencyCommand.java
##########
@@ -132,10 +150,48 @@
         cmd = of(argIter.nextArg("Expected consistency action."));
 
         if (cmd == REPAIR) {
-            String cacheName = argIter.nextArg("Expected cache name.");
-            int part = argIter.nextNonNegativeIntArg("Expected partition.");
+            String cacheName = null;
+            int part = -1;
+            ReadRepairStrategy strategy = null;
+
+            while (argIter.hasNextArg()) {
+                String arg = argIter.peekNextArg();
+
+                if (C.equals(arg) || CACHE.equals(arg) ||
+                    P.equals(arg) || PARTITION.equals(arg) ||
+                    S.equals(arg) || STRATEGY.equals(arg)) {
+                    arg = argIter.nextArg("Expected parameter key.");
+
+                    switch (arg) {
+                        case C:
+                        case CACHE:
+                            cacheName = argIter.nextArg("Expected cache 
name.");
+
+                            break;
+
+                        case P:
+                        case PARTITION:
+                            part = argIter.nextNonNegativeIntArg("Expected 
partition.");
+
+                            break;
+
+                        case S:
+                        case STRATEGY:
+                            strategy = 
ReadRepairStrategy.fromString(argIter.nextArg("Expected strategy."));
+
+                            break;
+
+                        default:
+                            throw new IllegalArgumentException("Illegal 
argument: " + arg);
+                    }
+                }
+                else
+                    break;
+            }
 
-            ReadRepairStrategy strategy = 
ReadRepairStrategy.fromString(argIter.nextArg("Expected strategy."));
+            assert cacheName != null;

Review comment:
       Done




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