Mmuzaf commented on code in PR #2497:
URL: https://github.com/apache/cassandra/pull/2497#discussion_r2204599671


##########
src/java/org/apache/cassandra/tools/nodetool/SetCacheCapacity.java:
##########
@@ -17,28 +17,40 @@
  */
 package org.apache.cassandra.tools.nodetool;
 
-import static com.google.common.base.Preconditions.checkArgument;
-import io.airlift.airline.Arguments;
-import io.airlift.airline.Command;
-
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Optional;
 
 import org.apache.cassandra.tools.NodeProbe;
-import org.apache.cassandra.tools.NodeTool.NodeToolCmd;
+import org.apache.cassandra.tools.nodetool.layout.CassandraUsage;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.Parameters;
+
+import static com.google.common.base.Preconditions.checkArgument;
 
 @Command(name = "setcachecapacity", description = "Set global key, row, and 
counter cache capacities (in MB units)")
-public class SetCacheCapacity extends NodeToolCmd
+public class SetCacheCapacity extends AbstractCommand
 {
-    @Arguments(title = "<key-cache-capacity> <row-cache-capacity> 
<counter-cache-capacity>",
-               usage = "<key-cache-capacity> <row-cache-capacity> 
<counter-cache-capacity>",
-               description = "Key cache, row cache, and counter cache (in MB)",
-               required = true)
+    @CassandraUsage(usage = "<key-cache-capacity> <row-cache-capacity> 
<counter-cache-capacity>",
+                    description = "Key cache, row cache, and counter cache (in 
MB)")
     private List<Integer> args = new ArrayList<>();
 
+    @Parameters(paramLabel = "key-cache-capacity", description = "Key cache 
capacity in MB", arity = "0..1", index = "0")

Review Comment:
   https://github.com/apache/cassandra/pull/2497#discussion_r2204598272



##########
src/java/org/apache/cassandra/tools/nodetool/SetTimeout.java:
##########
@@ -17,28 +17,36 @@
  */
 package org.apache.cassandra.tools.nodetool;
 
-import io.airlift.airline.Arguments;
-import io.airlift.airline.Command;
 
 import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.cassandra.tools.NodeProbe;
-import org.apache.cassandra.tools.NodeTool.NodeToolCmd;
+import org.apache.cassandra.tools.nodetool.layout.CassandraUsage;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.Parameters;
 
 import static com.google.common.base.Preconditions.checkArgument;
+import static org.apache.cassandra.tools.nodetool.CommandUtils.concatArgs;
 
 @Command(name = "settimeout", description = "Set the specified timeout in ms, 
or 0 to disable timeout")
-public class SetTimeout extends NodeToolCmd
+public class SetTimeout extends AbstractCommand
 {
-    @Arguments(usage = "<timeout_type> <timeout_in_ms>", description = 
"Timeout type followed by value in ms " +
-            "(0 disables socket streaming timeout). Type should be one of (" + 
GetTimeout.TIMEOUT_TYPES + ")",
-            required = true)
+    @CassandraUsage(usage = "<timeout_type> <timeout_in_ms>", description = 
"Timeout type followed by value in ms " +
+                                                                            
"(0 disables socket streaming timeout). Type should be one of (" + 
GetTimeout.TIMEOUT_TYPES + ")")
     private List<String> args = new ArrayList<>();
 
+    @Parameters(paramLabel = "timeout_type", description = "Timeout type", 
index = "0", arity = "0..1")

Review Comment:
   https://github.com/apache/cassandra/pull/2497#discussion_r2204598272



##########
src/java/org/apache/cassandra/tools/nodetool/UpdateCIDRGroup.java:
##########
@@ -20,26 +20,34 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import io.airlift.airline.Arguments;
-import io.airlift.airline.Command;
 import org.apache.cassandra.auth.AuthKeyspace;
 import org.apache.cassandra.tools.NodeProbe;
-import org.apache.cassandra.tools.NodeTool.NodeToolCmd;
+import org.apache.cassandra.tools.nodetool.layout.CassandraUsage;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.Parameters;
 
 import static com.google.common.base.Preconditions.checkArgument;
+import static org.apache.cassandra.tools.nodetool.CommandUtils.concatArgs;
 
 /**
  * Nodetool command to insert/update a CIDR group and associated mapping in 
the table {@link AuthKeyspace#CIDR_GROUPS}
  */
 @Command(name = "updatecidrgroup", description = "Insert/Update a cidr group")
-public class UpdateCIDRGroup extends NodeToolCmd
+public class UpdateCIDRGroup extends AbstractCommand
 {
-    @Arguments(usage = "[<cidrGroup> <cidr> ...]", description = "Requires a 
cidr group name, followed by one or more CIDRs separated by space")
-    private List<String> args = new ArrayList<>();
+    @CassandraUsage(usage = "[<cidrGroup> <cidr> ...]", description = 
"Requires a cidr group name, followed by one or more CIDRs separated by space")
+    public List<String> args = new ArrayList<>();
+
+    @Parameters(index = "0", description = "Name of the CIDR group", arity = 
"0..1")

Review Comment:
   https://github.com/apache/cassandra/pull/2497#discussion_r2204598272



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to