/** * Create a new CLI interface for a application and its bootstrapped environment. * * @param location the location of the application * @param bootstrap the bootstrap for the application * @param stdOut standard out * @param stdErr standard err */ public Cli(JarLocation location, Bootstrap<?> bootstrap, OutputStream stdOut, OutputStream stdErr) { this.stdOut = new PrintWriter(new OutputStreamWriter(stdOut, StandardCharsets.UTF_8), true); this.stdErr = new PrintWriter(new OutputStreamWriter(stdErr, StandardCharsets.UTF_8), true); this.commands = new TreeMap<>(); this.parser = buildParser(location); this.bootstrap = bootstrap; for (Command command : bootstrap.getCommands()) { addCommand(command); } }
/** * Create a new CLI interface for a application and its bootstrapped environment. * * @param location the location of the application * @param bootstrap the bootstrap for the application * @param stdOut standard out * @param stdErr standard err */ public Cli(JarLocation location, Bootstrap<?> bootstrap, OutputStream stdOut, OutputStream stdErr) { this.stdOut = new PrintWriter(new OutputStreamWriter(stdOut, StandardCharsets.UTF_8), true); this.stdErr = new PrintWriter(new OutputStreamWriter(stdErr, StandardCharsets.UTF_8), true); this.commands = new TreeMap<>(); this.parser = buildParser(location); this.bootstrap = bootstrap; for (Command command : bootstrap.getCommands()) { addCommand(command); } }
@SuppressWarnings("unchecked") private void afterInjectorCreation() { CommandSupport.initCommands(context.getBootstrap().getCommands(), injector, context.stat()); if (scanner != null) { scanner.cleanup(); } }
@SuppressWarnings("unchecked") private void afterInjectorCreation() { CommandSupport.initCommands(context.getBootstrap().getCommands(), injector, context.stat()); if (scanner != null) { scanner.cleanup(); } }