use of org.jboss.as.cli.impl.aesh.cmd.operation.LegacyCommandContainer in project wildfly-core by wildfly.
the class HelpSupportTestCase method testCLICommands.
@Test
public void testCLICommands() throws Exception {
CommandContextImpl ctx = (CommandContextImpl) CommandContextFactory.getInstance().newCommandContext();
AeshCommands commands = ctx.getAeshCommands();
for (String name : commands.getRegistry().getAllCommandNames()) {
CLICommandContainer container = (CLICommandContainer) commands.getRegistry().getCommand(name, name);
if (!(container.getWrappedContainer() instanceof LegacyCommandContainer) && !isAeshExtension(container.getParser().getCommand())) {
HelpSupport.checkCommand(null, container.getParser());
for (CommandLineParser<CLICommandInvocation> child : container.getParser().getAllChildParsers()) {
HelpSupport.checkCommand(container.getParser(), child);
}
}
}
}
use of org.jboss.as.cli.impl.aesh.cmd.operation.LegacyCommandContainer in project wildfly-core by wildfly.
the class CLICommandRegistry method registerHandler.
@Override
public void registerHandler(CommandHandler handler, boolean tabComplete, String... names) throws RegisterHandlerException {
RegisterHandlerException error = null;
for (String name : names) {
try {
checkExistence(name);
} catch (CommandLineException ex) {
if (error == null) {
error = new RegisterHandlerException(name);
} else {
error.addCommand(name);
}
}
}
if (error != null) {
throw error;
}
super.registerHandler(handler, tabComplete, names);
if (tabComplete) {
try {
addCommandContainer(new LegacyCommandContainer(ctx, names, handler), false);
} catch (CommandLineException | CommandLineParserException ex) {
throw new RegisterHandlerException(ex.getLocalizedMessage());
}
}
}
Aggregations