smiklosovic commented on code in PR #3902:
URL: https://github.com/apache/cassandra/pull/3902#discussion_r1967522012


##########
src/java/org/apache/cassandra/tools/nodetool/Status.java:
##########
@@ -36,44 +36,39 @@
 
 import com.google.common.collect.ArrayListMultimap;
 
-import io.airlift.airline.Arguments;
-import io.airlift.airline.Command;
-import io.airlift.airline.Option;
 import org.apache.cassandra.io.util.FileUtils;
 import org.apache.cassandra.locator.EndpointSnitchInfoMBean;
 import org.apache.cassandra.locator.InetAddressAndPort;
 import org.apache.cassandra.tools.NodeProbe;
-import org.apache.cassandra.tools.NodeTool;
-import org.apache.cassandra.tools.NodeTool.NodeToolCmd;
 import org.apache.cassandra.tools.nodetool.formatter.TableBuilder;
 import org.apache.cassandra.utils.LocalizeString;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.Option;
+import picocli.CommandLine.Parameters;
 
 import static java.util.stream.Collectors.toMap;
 
-@SuppressWarnings("UseOfSystemOutOrSystemErr")
 @Command(name = "status", description = "Print cluster information (state, 
load, IDs, ...)")
-public class Status extends NodeToolCmd
+public class Status extends WithPortDisplayAbstractCommand
 {
-    @Arguments(usage = "[<keyspace>]", description = "The keyspace name")
+    @Parameters(description = "The keyspace name", arity = "0..1")
     private String keyspace = null;
 
-    @Option(title = "resolve_ip", name = { "-r", "--resolve-ip" }, description 
= "Show node domain names instead of IPs")
+    @Option(paramLabel = "resolve_ip", names = { "-r", "--resolve-ip" }, 
description = "Show node domain names instead of IPs")
     private boolean resolveIp = false;
 
-    @Option(title = "sort",
-    name = { "-s", "--sort" },
-    description = "Sort by one of 'ip', 'host', 'load', 'owns', 'id', 'rack', 
'state' or 'token'. " +
-                  "Default ordering is ascending for 'ip', 'host', 'id', 
'token', 'rack' and descending for 'load', 'owns', 'state'. " +
-                  "Sorting by token is possible only when cluster does not use 
vnodes. When using vnodes, default " +
-                  "sorting is by id otherwise by token.",
-    allowedValues = { "ip", "host", "load", "owns", "id", "rack", "state", 
"token" })
-    private String sortBy = null;
-
-    @Option(title = "sort_order",
-    name = { "-o", "--order" },
-    description = "Sorting order: 'asc' for ascending, 'desc' for descending.",
-    allowedValues = { "asc", "desc" })
-    private String sortOrder = null;
+    @Option(paramLabel = "sort",
+            names = { "-s", "--sort" },
+            description = "Sort by one of 'ip', 'host', 'load', 'owns', 'id', 
'rack', 'state' or 'token'. " +
+                          "Default ordering is ascending for 'ip', 'host', 
'id', 'token', 'rack' and descending for 'load', 'owns', 'state'. " +
+                          "Sorting by token is possible only when cluster does 
not use vnodes. When using vnodes, default " +
+                          "sorting is by id otherwise by token.")
+    private SortBy sortBy = null;

Review Comment:
   I see this is happening at more places, I just comment here. Is not it true 
that when we do 
   
   `private Object abc = null;`
   
   it is `null` _already?
   
   When Picocli is finished with the parsing, that will be `null` anyway, no? 
   
   Same for `String`. `String abc = null;` is just same as without null. 
   
   I think it is also same for `boolean`. When a boolean property is not set, 
it is set to `false` automatically. We would need to keep it initialized on 
declaration when it is `true` only I guess.



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