@Test public void testRun() throws Exception { ProdigyCommand command = new ProdigyCommand(new Shell()); Line line = new Line("prodigy", Arrays.asList("one liner")); command.run(line); Log log = LogFactory.getLog(getClass()); assertFalse(log.isDebugEnabled()); command = new ProdigyCommand(new Shell()); Map<String, String> map = new HashMap<>(); map.put("v", ""); line = new Line("prodigy", map, Arrays.asList("one liner")); LogManager.shutdown(); command.run(line); log = LogFactory.getLog(getClass()); assertTrue(log.isDebugEnabled()); command = new ProdigyCommand(new Shell()); map.clear(); map.put("verbose", ""); line = new Line("prodigy", map, Arrays.asList("one liner")); LogManager.shutdown(); command.run(line); log = LogFactory.getLog(getClass()); assertTrue(log.isDebugEnabled()); command = new ProdigyCommand(new Shell()); map.clear(); map.put("config", "/path/to/not-found.yml"); line = new Line("prodigy", map, Arrays.asList("one liner")); command.run(line); Shell shell = command.shell(); Map<String, Command> commands = shell.commands(); assertThat(commands.size(), is(1)); assertThat(commands.get(new DeployCommand(null, null, null).name()), instanceOf(DeployCommand.class)); command = new ProdigyCommand(new Shell()); map.clear(); map.put("config", getClass().getResource("/prodigy-command-test.yml").getPath()); line = new Line("prodigy", map, Arrays.asList("one liner")); command.run(line); shell = command.shell(); commands = shell.commands(); assertThat(commands.size(), is(7)); assertThat(commands.get(new DeployCommand(null, null, null).name()), instanceOf(DeployCommand.class)); assertThat(commands.get(new InjectCommand(null, null).name()), instanceOf(InjectCommand.class)); assertThat(commands.get(new EjectCommand(null, null).name()), instanceOf(EjectCommand.class)); assertThat(commands.get(new ConfigureCommand(null, null, null).name()), instanceOf(ConfigureCommand.class)); assertThat(commands.get(new StatusCommand(null, null).name()), instanceOf(StatusCommand.class)); assertThat(commands.get(new FaultsCommand(null, null).name()), instanceOf(FaultsCommand.class)); assertThat(commands.get(new PushCommand(null, null).name()), instanceOf(PushCommand.class)); command = new ProdigyCommand(spyShell()); map.clear(); map.put("config", "/path/to/not-found.yml"); command.run(new Line("prodigy", map, new ArrayList<>())); shell = command.shell(); verify(shell).start(); assertThat(shell.console().prompt(), is("prodigy> ")); commands = shell.commands(); assertThat(commands.size(), is(4)); assertThat(commands.get(new DeployCommand(null, null, null).name()), instanceOf(DeployCommand.class)); assertThat(commands.get(new HintCommand(null).name()), instanceOf(HintCommand.class)); assertThat(commands.get(new HelpCommand(null).name()), instanceOf(HelpCommand.class)); assertThat(commands.get(new ExitCommand(null).name()), instanceOf(ExitCommand.class)); command = new ProdigyCommand(spyShell()); map.clear(); map.put("config", getClass().getResource("/prodigy-command-test.yml").getPath()); command.run(new Line("prodigy", map, new ArrayList<>())); shell = command.shell(); verify(shell).start(); assertThat(shell.console().prompt(), is("prodigy|profile-1> ")); commands = shell.commands(); assertThat(commands.size(), is(10)); assertThat(commands.get(new DeployCommand(null, null, null).name()), instanceOf(DeployCommand.class)); assertThat(commands.get(new InjectCommand(null, null).name()), instanceOf(InjectCommand.class)); assertThat(commands.get(new EjectCommand(null, null).name()), instanceOf(EjectCommand.class)); assertThat(commands.get(new ConfigureCommand(null, null, null).name()), instanceOf(ConfigureCommand.class)); assertThat(commands.get(new StatusCommand(null, null).name()), instanceOf(StatusCommand.class)); assertThat(commands.get(new FaultsCommand(null, null).name()), instanceOf(FaultsCommand.class)); assertThat(commands.get(new PushCommand(null, null).name()), instanceOf(PushCommand.class)); assertThat(commands.get(new HintCommand(null).name()), instanceOf(HintCommand.class)); assertThat(commands.get(new HelpCommand(null).name()), instanceOf(HelpCommand.class)); assertThat(commands.get(new ExitCommand(null).name()), instanceOf(ExitCommand.class)); command = new ProdigyCommand(spyShell()); map.clear(); map.put("config", getClass().getResource("/prodigy-command-test-2.yml").getPath()); command.run(new Line("prodigy", map, new ArrayList<>())); shell = command.shell(); verify(shell).start(); assertThat(shell.console().prompt(), is("prodigy> ")); commands = shell.commands(); assertThat(commands.size(), is(10)); assertThat(commands.get(new DeployCommand(null, null, null).name()), instanceOf(DeployCommand.class)); assertThat(commands.get(new InjectCommand(null, null).name()), instanceOf(InjectCommand.class)); assertThat(commands.get(new EjectCommand(null, null).name()), instanceOf(EjectCommand.class)); assertThat(commands.get(new ConfigureCommand(null, null, null).name()), instanceOf(ConfigureCommand.class)); assertThat(commands.get(new StatusCommand(null, null).name()), instanceOf(StatusCommand.class)); assertThat(commands.get(new FaultsCommand(null, null).name()), instanceOf(FaultsCommand.class)); assertThat(commands.get(new PushCommand(null, null).name()), instanceOf(PushCommand.class)); assertThat(commands.get(new HintCommand(null).name()), instanceOf(HintCommand.class)); assertThat(commands.get(new HelpCommand(null).name()), instanceOf(HelpCommand.class)); assertThat(commands.get(new ExitCommand(null).name()), instanceOf(ExitCommand.class)); }
@Override public void run(Line line) throws Exception { Map<String, String> options = line.options(); boolean verbose = options.containsKey("v") || options.containsKey("verbose"); Configurator.setRootLevel((verbose) ? Level.DEBUG : Level.INFO); Log log = LogFactory.getLog(getClass()); Path path = null; if (options.containsKey("config")) { path = Paths.get(options.get("config")); } else { path = Paths.get(Environment.getProperty("user.home"), CONFIGURATION); } Map<String, Object> configuration = new LinkedHashMap<>(); if (Files.exists(path)) { ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); configuration = mapper.readValue(path.toFile(), new TypeReference<Map<String, Object>>() {}); log.info("Configuration file [" + path + "] loaded"); shell.register(new InjectCommand(shell, configuration)); shell.register(new EjectCommand(shell, configuration)); shell.register(new ConfigureCommand(shell, configuration, path)); shell.register(new StatusCommand(shell, configuration)); shell.register(new FaultsCommand(shell, configuration)); shell.register(new PushCommand(shell, configuration)); log.debug("Command [" + InjectCommand.class.getName() + "] enabled"); log.debug("Command [" + EjectCommand.class.getName() + "] enabled"); log.debug("Command [" + ConfigureCommand.class.getName() + "] enabled"); log.debug("Command [" + StatusCommand.class.getName() + "] enabled"); log.debug("Command [" + FaultsCommand.class.getName() + "] enabled"); log.debug("Command [" + PushCommand.class.getName() + "] enabled"); } else { log.debug("Configuration file [" + path + "] not found"); log.debug("Command [" + InjectCommand.class.getName() + "] disabled"); log.debug("Command [" + EjectCommand.class.getName() + "] disabled"); log.debug("Command [" + ConfigureCommand.class.getName() + "] disabled"); log.debug("Command [" + StatusCommand.class.getName() + "] disabled"); log.debug("Command [" + FaultsCommand.class.getName() + "] disabled"); log.debug("Command [" + PushCommand.class.getName() + "] enabled"); } shell.register(new DeployCommand(shell, configuration, path)); log.debug("Command [" + DeployCommand.class.getName() + "] enabled"); List<String> args = line.args(); if (args.isEmpty()) { log.debug("Run into the REPL mode"); shell.register(new HintCommand(shell)); shell.register(new HelpCommand(shell)); shell.register(new ExitCommand(shell)); log.debug("Command [" + HintCommand.class.getName() + "] enabled"); log.debug("Command [" + HelpCommand.class.getName() + "] enabled"); log.debug("Command [" + ExitCommand.class.getName() + "] enabled"); CliProperties properties = new CliProperties(); properties.load(); Console console = shell.console(); console.println(Colors.yellow("__________ .___.__ ")); console.println(Colors.yellow("\\______ \\_______ ____ __| _/|__| ____ ___.__.")); console.println(Colors.yellow(" | ___/\\_ __ \\/ _ \\ / __ | | |/ ___< | |")); console.println(Colors.yellow(" | | | | \\( <_> ) /_/ | | / /_/ >___ |")); console.println(Colors.yellow(" |____| |__| \\____/\\____ | |__\\___ console.println(Colors.yellow(" \\/ /_____/ \\/ " + " v" + properties.version("prodigy.cli"))); console.println(""); console.println(Colors.yellow("Chaos Engineering experiment for AWS Java applications")); console.println(""); console.println( Colors.yellow("Welcome to Prodigy. Hit the TAB or press 'hint' to display available commands.")); console.println(Colors.yellow("Press 'help <command>' to display the detailed information for the command.")); console.println(Colors.yellow("Press 'exit' to exit this session.")); console.println(""); String profile = ""; if (configuration.containsKey("default")) { profile = (String) configuration.get("default"); log.debug("Default profile [" + profile + "] configured"); profile = "|" + profile; } console.prompt("prodigy" + profile + "> "); shell.start(); } else { log.debug("Run into the one liner mode"); String l = StringUtils.join(args, " "); shell.exec(l); } }
ProdigyCommand implements Command { @Override public void run(Line line) throws Exception { Map<String, String> options = line.options(); boolean verbose = options.containsKey("v") || options.containsKey("verbose"); Configurator.setRootLevel((verbose) ? Level.DEBUG : Level.INFO); Log log = LogFactory.getLog(getClass()); Path path = null; if (options.containsKey("config")) { path = Paths.get(options.get("config")); } else { path = Paths.get(Environment.getProperty("user.home"), CONFIGURATION); } Map<String, Object> configuration = new LinkedHashMap<>(); if (Files.exists(path)) { ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); configuration = mapper.readValue(path.toFile(), new TypeReference<Map<String, Object>>() {}); log.info("Configuration file [" + path + "] loaded"); shell.register(new InjectCommand(shell, configuration)); shell.register(new EjectCommand(shell, configuration)); shell.register(new ConfigureCommand(shell, configuration, path)); shell.register(new StatusCommand(shell, configuration)); shell.register(new FaultsCommand(shell, configuration)); shell.register(new PushCommand(shell, configuration)); log.debug("Command [" + InjectCommand.class.getName() + "] enabled"); log.debug("Command [" + EjectCommand.class.getName() + "] enabled"); log.debug("Command [" + ConfigureCommand.class.getName() + "] enabled"); log.debug("Command [" + StatusCommand.class.getName() + "] enabled"); log.debug("Command [" + FaultsCommand.class.getName() + "] enabled"); log.debug("Command [" + PushCommand.class.getName() + "] enabled"); } else { log.debug("Configuration file [" + path + "] not found"); log.debug("Command [" + InjectCommand.class.getName() + "] disabled"); log.debug("Command [" + EjectCommand.class.getName() + "] disabled"); log.debug("Command [" + ConfigureCommand.class.getName() + "] disabled"); log.debug("Command [" + StatusCommand.class.getName() + "] disabled"); log.debug("Command [" + FaultsCommand.class.getName() + "] disabled"); log.debug("Command [" + PushCommand.class.getName() + "] enabled"); } shell.register(new DeployCommand(shell, configuration, path)); log.debug("Command [" + DeployCommand.class.getName() + "] enabled"); List<String> args = line.args(); if (args.isEmpty()) { log.debug("Run into the REPL mode"); shell.register(new HintCommand(shell)); shell.register(new HelpCommand(shell)); shell.register(new ExitCommand(shell)); log.debug("Command [" + HintCommand.class.getName() + "] enabled"); log.debug("Command [" + HelpCommand.class.getName() + "] enabled"); log.debug("Command [" + ExitCommand.class.getName() + "] enabled"); CliProperties properties = new CliProperties(); properties.load(); Console console = shell.console(); console.println(Colors.yellow("__________ .___.__ ")); console.println(Colors.yellow("\\______ \\_______ ____ __| _/|__| ____ ___.__.")); console.println(Colors.yellow(" | ___/\\_ __ \\/ _ \\ / __ | | |/ ___< | |")); console.println(Colors.yellow(" | | | | \\( <_> ) /_/ | | / /_/ >___ |")); console.println(Colors.yellow(" |____| |__| \\____/\\____ | |__\\___ console.println(Colors.yellow(" \\/ /_____/ \\/ " + " v" + properties.version("prodigy.cli"))); console.println(""); console.println(Colors.yellow("Chaos Engineering experiment for AWS Java applications")); console.println(""); console.println( Colors.yellow("Welcome to Prodigy. Hit the TAB or press 'hint' to display available commands.")); console.println(Colors.yellow("Press 'help <command>' to display the detailed information for the command.")); console.println(Colors.yellow("Press 'exit' to exit this session.")); console.println(""); String profile = ""; if (configuration.containsKey("default")) { profile = (String) configuration.get("default"); log.debug("Default profile [" + profile + "] configured"); profile = "|" + profile; } console.prompt("prodigy" + profile + "> "); shell.start(); } else { log.debug("Run into the one liner mode"); String l = StringUtils.join(args, " "); shell.exec(l); } } }
ProdigyCommand implements Command { @Override public void run(Line line) throws Exception { Map<String, String> options = line.options(); boolean verbose = options.containsKey("v") || options.containsKey("verbose"); Configurator.setRootLevel((verbose) ? Level.DEBUG : Level.INFO); Log log = LogFactory.getLog(getClass()); Path path = null; if (options.containsKey("config")) { path = Paths.get(options.get("config")); } else { path = Paths.get(Environment.getProperty("user.home"), CONFIGURATION); } Map<String, Object> configuration = new LinkedHashMap<>(); if (Files.exists(path)) { ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); configuration = mapper.readValue(path.toFile(), new TypeReference<Map<String, Object>>() {}); log.info("Configuration file [" + path + "] loaded"); shell.register(new InjectCommand(shell, configuration)); shell.register(new EjectCommand(shell, configuration)); shell.register(new ConfigureCommand(shell, configuration, path)); shell.register(new StatusCommand(shell, configuration)); shell.register(new FaultsCommand(shell, configuration)); shell.register(new PushCommand(shell, configuration)); log.debug("Command [" + InjectCommand.class.getName() + "] enabled"); log.debug("Command [" + EjectCommand.class.getName() + "] enabled"); log.debug("Command [" + ConfigureCommand.class.getName() + "] enabled"); log.debug("Command [" + StatusCommand.class.getName() + "] enabled"); log.debug("Command [" + FaultsCommand.class.getName() + "] enabled"); log.debug("Command [" + PushCommand.class.getName() + "] enabled"); } else { log.debug("Configuration file [" + path + "] not found"); log.debug("Command [" + InjectCommand.class.getName() + "] disabled"); log.debug("Command [" + EjectCommand.class.getName() + "] disabled"); log.debug("Command [" + ConfigureCommand.class.getName() + "] disabled"); log.debug("Command [" + StatusCommand.class.getName() + "] disabled"); log.debug("Command [" + FaultsCommand.class.getName() + "] disabled"); log.debug("Command [" + PushCommand.class.getName() + "] enabled"); } shell.register(new DeployCommand(shell, configuration, path)); log.debug("Command [" + DeployCommand.class.getName() + "] enabled"); List<String> args = line.args(); if (args.isEmpty()) { log.debug("Run into the REPL mode"); shell.register(new HintCommand(shell)); shell.register(new HelpCommand(shell)); shell.register(new ExitCommand(shell)); log.debug("Command [" + HintCommand.class.getName() + "] enabled"); log.debug("Command [" + HelpCommand.class.getName() + "] enabled"); log.debug("Command [" + ExitCommand.class.getName() + "] enabled"); CliProperties properties = new CliProperties(); properties.load(); Console console = shell.console(); console.println(Colors.yellow("__________ .___.__ ")); console.println(Colors.yellow("\\______ \\_______ ____ __| _/|__| ____ ___.__.")); console.println(Colors.yellow(" | ___/\\_ __ \\/ _ \\ / __ | | |/ ___< | |")); console.println(Colors.yellow(" | | | | \\( <_> ) /_/ | | / /_/ >___ |")); console.println(Colors.yellow(" |____| |__| \\____/\\____ | |__\\___ console.println(Colors.yellow(" \\/ /_____/ \\/ " + " v" + properties.version("prodigy.cli"))); console.println(""); console.println(Colors.yellow("Chaos Engineering experiment for AWS Java applications")); console.println(""); console.println( Colors.yellow("Welcome to Prodigy. Hit the TAB or press 'hint' to display available commands.")); console.println(Colors.yellow("Press 'help <command>' to display the detailed information for the command.")); console.println(Colors.yellow("Press 'exit' to exit this session.")); console.println(""); String profile = ""; if (configuration.containsKey("default")) { profile = (String) configuration.get("default"); log.debug("Default profile [" + profile + "] configured"); profile = "|" + profile; } console.prompt("prodigy" + profile + "> "); shell.start(); } else { log.debug("Run into the one liner mode"); String l = StringUtils.join(args, " "); shell.exec(l); } } ProdigyCommand(Shell shell); }
ProdigyCommand implements Command { @Override public void run(Line line) throws Exception { Map<String, String> options = line.options(); boolean verbose = options.containsKey("v") || options.containsKey("verbose"); Configurator.setRootLevel((verbose) ? Level.DEBUG : Level.INFO); Log log = LogFactory.getLog(getClass()); Path path = null; if (options.containsKey("config")) { path = Paths.get(options.get("config")); } else { path = Paths.get(Environment.getProperty("user.home"), CONFIGURATION); } Map<String, Object> configuration = new LinkedHashMap<>(); if (Files.exists(path)) { ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); configuration = mapper.readValue(path.toFile(), new TypeReference<Map<String, Object>>() {}); log.info("Configuration file [" + path + "] loaded"); shell.register(new InjectCommand(shell, configuration)); shell.register(new EjectCommand(shell, configuration)); shell.register(new ConfigureCommand(shell, configuration, path)); shell.register(new StatusCommand(shell, configuration)); shell.register(new FaultsCommand(shell, configuration)); shell.register(new PushCommand(shell, configuration)); log.debug("Command [" + InjectCommand.class.getName() + "] enabled"); log.debug("Command [" + EjectCommand.class.getName() + "] enabled"); log.debug("Command [" + ConfigureCommand.class.getName() + "] enabled"); log.debug("Command [" + StatusCommand.class.getName() + "] enabled"); log.debug("Command [" + FaultsCommand.class.getName() + "] enabled"); log.debug("Command [" + PushCommand.class.getName() + "] enabled"); } else { log.debug("Configuration file [" + path + "] not found"); log.debug("Command [" + InjectCommand.class.getName() + "] disabled"); log.debug("Command [" + EjectCommand.class.getName() + "] disabled"); log.debug("Command [" + ConfigureCommand.class.getName() + "] disabled"); log.debug("Command [" + StatusCommand.class.getName() + "] disabled"); log.debug("Command [" + FaultsCommand.class.getName() + "] disabled"); log.debug("Command [" + PushCommand.class.getName() + "] enabled"); } shell.register(new DeployCommand(shell, configuration, path)); log.debug("Command [" + DeployCommand.class.getName() + "] enabled"); List<String> args = line.args(); if (args.isEmpty()) { log.debug("Run into the REPL mode"); shell.register(new HintCommand(shell)); shell.register(new HelpCommand(shell)); shell.register(new ExitCommand(shell)); log.debug("Command [" + HintCommand.class.getName() + "] enabled"); log.debug("Command [" + HelpCommand.class.getName() + "] enabled"); log.debug("Command [" + ExitCommand.class.getName() + "] enabled"); CliProperties properties = new CliProperties(); properties.load(); Console console = shell.console(); console.println(Colors.yellow("__________ .___.__ ")); console.println(Colors.yellow("\\______ \\_______ ____ __| _/|__| ____ ___.__.")); console.println(Colors.yellow(" | ___/\\_ __ \\/ _ \\ / __ | | |/ ___< | |")); console.println(Colors.yellow(" | | | | \\( <_> ) /_/ | | / /_/ >___ |")); console.println(Colors.yellow(" |____| |__| \\____/\\____ | |__\\___ console.println(Colors.yellow(" \\/ /_____/ \\/ " + " v" + properties.version("prodigy.cli"))); console.println(""); console.println(Colors.yellow("Chaos Engineering experiment for AWS Java applications")); console.println(""); console.println( Colors.yellow("Welcome to Prodigy. Hit the TAB or press 'hint' to display available commands.")); console.println(Colors.yellow("Press 'help <command>' to display the detailed information for the command.")); console.println(Colors.yellow("Press 'exit' to exit this session.")); console.println(""); String profile = ""; if (configuration.containsKey("default")) { profile = (String) configuration.get("default"); log.debug("Default profile [" + profile + "] configured"); profile = "|" + profile; } console.prompt("prodigy" + profile + "> "); shell.start(); } else { log.debug("Run into the one liner mode"); String l = StringUtils.join(args, " "); shell.exec(l); } } ProdigyCommand(Shell shell); @Override String name(); @Override Usage usage(); @Override void run(Line line); Shell shell(); }
ProdigyCommand implements Command { @Override public void run(Line line) throws Exception { Map<String, String> options = line.options(); boolean verbose = options.containsKey("v") || options.containsKey("verbose"); Configurator.setRootLevel((verbose) ? Level.DEBUG : Level.INFO); Log log = LogFactory.getLog(getClass()); Path path = null; if (options.containsKey("config")) { path = Paths.get(options.get("config")); } else { path = Paths.get(Environment.getProperty("user.home"), CONFIGURATION); } Map<String, Object> configuration = new LinkedHashMap<>(); if (Files.exists(path)) { ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); configuration = mapper.readValue(path.toFile(), new TypeReference<Map<String, Object>>() {}); log.info("Configuration file [" + path + "] loaded"); shell.register(new InjectCommand(shell, configuration)); shell.register(new EjectCommand(shell, configuration)); shell.register(new ConfigureCommand(shell, configuration, path)); shell.register(new StatusCommand(shell, configuration)); shell.register(new FaultsCommand(shell, configuration)); shell.register(new PushCommand(shell, configuration)); log.debug("Command [" + InjectCommand.class.getName() + "] enabled"); log.debug("Command [" + EjectCommand.class.getName() + "] enabled"); log.debug("Command [" + ConfigureCommand.class.getName() + "] enabled"); log.debug("Command [" + StatusCommand.class.getName() + "] enabled"); log.debug("Command [" + FaultsCommand.class.getName() + "] enabled"); log.debug("Command [" + PushCommand.class.getName() + "] enabled"); } else { log.debug("Configuration file [" + path + "] not found"); log.debug("Command [" + InjectCommand.class.getName() + "] disabled"); log.debug("Command [" + EjectCommand.class.getName() + "] disabled"); log.debug("Command [" + ConfigureCommand.class.getName() + "] disabled"); log.debug("Command [" + StatusCommand.class.getName() + "] disabled"); log.debug("Command [" + FaultsCommand.class.getName() + "] disabled"); log.debug("Command [" + PushCommand.class.getName() + "] enabled"); } shell.register(new DeployCommand(shell, configuration, path)); log.debug("Command [" + DeployCommand.class.getName() + "] enabled"); List<String> args = line.args(); if (args.isEmpty()) { log.debug("Run into the REPL mode"); shell.register(new HintCommand(shell)); shell.register(new HelpCommand(shell)); shell.register(new ExitCommand(shell)); log.debug("Command [" + HintCommand.class.getName() + "] enabled"); log.debug("Command [" + HelpCommand.class.getName() + "] enabled"); log.debug("Command [" + ExitCommand.class.getName() + "] enabled"); CliProperties properties = new CliProperties(); properties.load(); Console console = shell.console(); console.println(Colors.yellow("__________ .___.__ ")); console.println(Colors.yellow("\\______ \\_______ ____ __| _/|__| ____ ___.__.")); console.println(Colors.yellow(" | ___/\\_ __ \\/ _ \\ / __ | | |/ ___< | |")); console.println(Colors.yellow(" | | | | \\( <_> ) /_/ | | / /_/ >___ |")); console.println(Colors.yellow(" |____| |__| \\____/\\____ | |__\\___ console.println(Colors.yellow(" \\/ /_____/ \\/ " + " v" + properties.version("prodigy.cli"))); console.println(""); console.println(Colors.yellow("Chaos Engineering experiment for AWS Java applications")); console.println(""); console.println( Colors.yellow("Welcome to Prodigy. Hit the TAB or press 'hint' to display available commands.")); console.println(Colors.yellow("Press 'help <command>' to display the detailed information for the command.")); console.println(Colors.yellow("Press 'exit' to exit this session.")); console.println(""); String profile = ""; if (configuration.containsKey("default")) { profile = (String) configuration.get("default"); log.debug("Default profile [" + profile + "] configured"); profile = "|" + profile; } console.prompt("prodigy" + profile + "> "); shell.start(); } else { log.debug("Run into the one liner mode"); String l = StringUtils.join(args, " "); shell.exec(l); } } ProdigyCommand(Shell shell); @Override String name(); @Override Usage usage(); @Override void run(Line line); Shell shell();  }