public Class<?> apply(CommandMetadata input) { return input.getType(); } };
private static CommandMetadata findCommandMetadata(CommandMetadata result, CommandMetadata command, Class<? extends PrideCommand> type) { if (result != null) { return result; } if (command.getType().equals(type)) { return command; } return null; }
@Override public void run() throws Ap3Exception { if(null != groupMetadata) { CommandMetadata metadata = promptForApp(groupMetadata.getCommands()); Ap3Command command = cli.getParsedCommand(metadata.getType()); if(null != command) { command.run(); } } }
@Override public void run() throws Ap3Exception { if(null != groupMetadata) { CommandMetadata metadata = promptForKit(groupMetadata.getCommands()); Ap3Command command = cli.getParsedCommand(metadata.getType()); if(null != command) { command.run(); } } }
@Override public void run() throws Ap3Exception { Path projectFile = Paths.get("").resolve(Ap3ConfigurationManager.PROJECT_CONFIG_FILENAME); if(!global && Files.notExists(projectFile)) { try { prompter.showError("Current directory is not a valid AP3 project."); prompter.showWarning("Either re-run this command with the -g|--global flag, or run: ap3 init"); return; } catch (PrompterException e) { //do nothing } } if(null != groupMetadata) { CommandMetadata metadata = promptForConfigCommand(groupMetadata.getCommands()); Ap3Command command = cli.getParsedCommand(metadata.getType()); if(null != command) { command.run(); } } }
return createInstance(command.getType(), command.getAllOptions(), state.getParsedOptions(),