alex-plekhanov commented on code in PR #10576:
URL: https://github.com/apache/ignite/pull/10576#discussion_r1130814783
##########
modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/CommandHandler.java:
##########
@@ -155,14 +160,34 @@ public static IgniteLogger setupJavaLogger(String
appName, Class<?> cls) {
*
*/
public CommandHandler() {
- logger = setupJavaLogger("control-utility", CommandHandler.class);
+ this(setupJavaLogger("control-utility", CommandHandler.class));
}
/**
* @param logger Logger to use.
*/
public CommandHandler(IgniteLogger logger) {
this.logger = logger;
+ Iterable<CommandsProvider> it = U.loadService(CommandsProvider.class);
+
+ cmds = new HashMap<>();
+
+ new CommandsProviderImpl().commands().forEach((k, v) ->
cmds.put(k.toLowerCase(), v));
+
+ if (!F.isEmpty(it)) {
+ for (CommandsProvider provider : it) {
+ provider.commands().forEach((k, v) -> {
+ k = k.toLowerCase();
+
+ if (cmds.containsKey(k)) {
+ throw new IllegalArgumentException("Only one action
can be specified, but found at least two:" +
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]