Java 类org.springframework.boot.cli.command.CommandRunner 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SpringCli.java   
public static void main(String... args) {
    System.setProperty("java.awt.headless", Boolean.toString(true));
    LogbackInitializer.initialize();

    CommandRunner runner = new CommandRunner("spring");
    runner.addCommand(new HelpCommand(runner));
    addServiceLoaderCommands(runner);
    runner.addCommand(new ShellCommand());
    runner.addCommand(new HintCommand(runner));
    runner.setOptionCommands(HelpCommand.class, VersionCommand.class);
    runner.setHiddenCommands(HintCommand.class);

    int exitCode = runner.runAndHandleErrors(args);
    if (exitCode != 0) {
        // If successful, leave it to run in case it's a server app
        System.exit(exitCode);
    }
}
项目:spring-boot-concourse    文件:SpringCli.java   
public static void main(String... args) {
    System.setProperty("java.awt.headless", Boolean.toString(true));
    LogbackInitializer.initialize();

    CommandRunner runner = new CommandRunner("spring");
    runner.addCommand(new HelpCommand(runner));
    addServiceLoaderCommands(runner);
    runner.addCommand(new ShellCommand());
    runner.addCommand(new HintCommand(runner));
    runner.setOptionCommands(HelpCommand.class, VersionCommand.class);
    runner.setHiddenCommands(HintCommand.class);

    int exitCode = runner.runAndHandleErrors(args);
    if (exitCode != 0) {
        // If successful, leave it to run in case it's a server app
        System.exit(exitCode);
    }
}
项目:contestparser    文件:SpringCli.java   
public static void main(String... args) {
    System.setProperty("java.awt.headless", Boolean.toString(true));
    LogbackInitializer.initialize();

    CommandRunner runner = new CommandRunner("spring");
    runner.addCommand(new HelpCommand(runner));
    addServiceLoaderCommands(runner);
    runner.addCommand(new ShellCommand());
    runner.addCommand(new HintCommand(runner));
    runner.setOptionCommands(HelpCommand.class, VersionCommand.class);
    runner.setHiddenCommands(HintCommand.class);

    int exitCode = runner.runAndHandleErrors(args);
    if (exitCode != 0) {
        // If successful, leave it to run in case it's a server app
        System.exit(exitCode);
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SpringCli.java   
private static void addServiceLoaderCommands(CommandRunner runner) {
    ServiceLoader<CommandFactory> factories = ServiceLoader.load(CommandFactory.class,
            runner.getClass().getClassLoader());
    for (CommandFactory factory : factories) {
        runner.addCommands(factory.getCommands());
    }
}
项目:spring-boot-concourse    文件:SpringCli.java   
private static void addServiceLoaderCommands(CommandRunner runner) {
    ServiceLoader<CommandFactory> factories = ServiceLoader.load(CommandFactory.class,
            runner.getClass().getClassLoader());
    for (CommandFactory factory : factories) {
        runner.addCommands(factory.getCommands());
    }
}
项目:contestparser    文件:SpringCli.java   
private static void addServiceLoaderCommands(CommandRunner runner) {
    ServiceLoader<CommandFactory> factories = ServiceLoader.load(CommandFactory.class,
            runner.getClass().getClassLoader());
    for (CommandFactory factory : factories) {
        runner.addCommands(factory.getCommands());
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HintCommand.java   
public HintCommand(CommandRunner commandRunner) {
    super("hint", "Provides hints for shell auto-completion");
    this.commandRunner = commandRunner;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HelpCommand.java   
public HelpCommand(CommandRunner commandRunner) {
    super("help", "Get help on commands");
    this.commandRunner = commandRunner;
}
项目:spring-boot-concourse    文件:HintCommand.java   
public HintCommand(CommandRunner commandRunner) {
    super("hint", "Provides hints for shell auto-completion");
    this.commandRunner = commandRunner;
}
项目:spring-boot-concourse    文件:HelpCommand.java   
public HelpCommand(CommandRunner commandRunner) {
    super("help", "Get help on commands");
    this.commandRunner = commandRunner;
}
项目:contestparser    文件:HintCommand.java   
public HintCommand(CommandRunner commandRunner) {
    super("hint", "Provides hints for shell auto-completion");
    this.commandRunner = commandRunner;
}
项目:contestparser    文件:HelpCommand.java   
public HelpCommand(CommandRunner commandRunner) {
    super("help", "Get help on commands");
    this.commandRunner = commandRunner;
}