szetszwo commented on pull request #603:
URL: https://github.com/apache/ratis/pull/603#issuecomment-1046947031
```
+++ b/ratis-shell/src/main/java/org/apache/ratis/shell/cli/sh/RatisShell.java
@@ -72,9 +72,12 @@ public class RatisShell extends AbstractShell {
// Add commands from <pkgName>.command.*
if (cls.getPackage().getName().equals(pkgName + ".command")
&& !Modifier.isAbstract(cls.getModifiers())) {
+ System.out.println("Found " + cls);
// Only instantiate a concrete class
final Command cmd = ReflectionUtils.newInstance(cls, classArgs,
objectArgs);
commandsMap.put(cmd.getCommandName(), cmd);
+ } else {
+ System.out.println("Ignored " + cls);
}
}
```
@codings-dan , if we add the code above, the new subcommnads will be ignored.
```
Ignored class org.apache.ratis.shell.cli.sh.command.AbstractRatisCommand
Found class org.apache.ratis.shell.cli.sh.command.PeerCommand
Found class org.apache.ratis.shell.cli.sh.command.ElectionCommand
Ignored class org.apache.ratis.shell.cli.sh.group.GroupListCommand
Found class org.apache.ratis.shell.cli.sh.command.SetPriorityCommand
Ignored class org.apache.ratis.shell.cli.sh.group.GroupInfoCommand
Ignored class org.apache.ratis.shell.cli.sh.snapshot.TakeSnapshotCommand
Ignored class org.apache.ratis.shell.cli.sh.election.PauseCommand
Found class org.apache.ratis.shell.cli.sh.command.SnapshotCommand
Found class org.apache.ratis.shell.cli.sh.command.GroupCommand
Ignored class org.apache.ratis.shell.cli.sh.election.TransferCommand
Ignored class org.apache.ratis.shell.cli.sh.election.ResumeCommand
Usage: ratis sh [generic options]
[election [resume] [transfer] [pause]]
[group [list] [info]]
[peer -peers
<PEER0_HOST:PEER0_PORT,PEER1_HOST:PEER1_PORT,PEER2_HOST:PEER2_PORT> [-groupid
<RAFT_GROUP_ID>] -remove <PEER_HOST:PEER_PORT> -add <PEER_HOST:PEER_PORT>]
[setPriority -peers
<PEER0_HOST:PEER0_PORT,PEER1_HOST:PEER1_PORT,PEER2_HOST:PEER2_PORT> [-groupid
<RAFT_GROUP_ID>] -addressPriority <PEER_HOST:PEER_PORT|PRIORITY>]
[snapshot [create]]
```
--
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]