private AbstractShellInteraction findCommand(ShellContext shellContext, String commandName) { AbstractShellInteraction result = null; UICommand cmd = commandFactory.getNewCommandByName(shellContext, commandName); if (cmd != null && cmd.isEnabled(shellContext)) { CommandController controller = commandControllerFactory.createController(shellContext, shell, cmd); if (controller instanceof WizardCommandController) { result = new ShellWizard( (WizardCommandController) controller, shellContext, commandLineUtil, this); } else { result = new ShellSingleCommand(controller, shellContext, commandLineUtil); } } return result; }
private Set<String> getForgeCommandNames() { try (ShellContextImpl newShellContext = shell.createUIContext()) { return commandFactory.getEnabledCommandNames(newShellContext); } }