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

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:InitCommand.java   
@Override
public Collection<HelpExample> getExamples() {
    List<HelpExample> examples = new ArrayList<HelpExample>();
    examples.add(new HelpExample("To list all the capabilities of the service",
            "spring init --list"));
    examples.add(new HelpExample("To creates a default project", "spring init"));
    examples.add(new HelpExample("To create a web my-app.zip",
            "spring init -d=web my-app.zip"));
    examples.add(new HelpExample("To create a web/data-jpa gradle project unpacked",
            "spring init -d=web,jpa --build=gradle my-dir"));
    return examples;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HelpCommand.java   
@Override
public ExitStatus run(String... args) throws Exception {
    if (args.length == 0) {
        throw new NoHelpCommandArgumentsException();
    }
    String commandName = args[0];
    for (Command command : this.commandRunner) {
        if (command.getName().equals(commandName)) {
            Log.info(this.commandRunner.getName() + command.getName() + " - "
                    + command.getDescription());
            Log.info("");
            if (command.getUsageHelp() != null) {
                Log.info("usage: " + this.commandRunner.getName() + command.getName()
                        + " " + command.getUsageHelp());
                Log.info("");
            }
            if (command.getHelp() != null) {
                Log.info(command.getHelp());
            }
            Collection<HelpExample> examples = command.getExamples();
            if (examples != null) {
                Log.info(examples.size() == 1 ? "example:" : "examples:");
                Log.info("");
                for (HelpExample example : examples) {
                    Log.info("    " + example.getDescription() + ":");
                    Log.info("        $ " + example.getExample());
                    Log.info("");
                }
                Log.info("");
            }
            return ExitStatus.OK;
        }
    }
    throw new NoSuchCommandException(commandName);
}
项目:spring-boot-concourse    文件:InitCommand.java   
@Override
public Collection<HelpExample> getExamples() {
    List<HelpExample> examples = new ArrayList<HelpExample>();
    examples.add(new HelpExample("To list all the capabilities of the service",
            "spring init --list"));
    examples.add(new HelpExample("To creates a default project", "spring init"));
    examples.add(new HelpExample("To create a web my-app.zip",
            "spring init -d=web my-app.zip"));
    examples.add(new HelpExample("To create a web/data-jpa gradle project unpacked",
            "spring init -d=web,jpa --build=gradle my-dir"));
    return examples;
}
项目:spring-boot-concourse    文件:HelpCommand.java   
@Override
public ExitStatus run(String... args) throws Exception {
    if (args.length == 0) {
        throw new NoHelpCommandArgumentsException();
    }
    String commandName = args[0];
    for (Command command : this.commandRunner) {
        if (command.getName().equals(commandName)) {
            Log.info(this.commandRunner.getName() + command.getName() + " - "
                    + command.getDescription());
            Log.info("");
            if (command.getUsageHelp() != null) {
                Log.info("usage: " + this.commandRunner.getName() + command.getName()
                        + " " + command.getUsageHelp());
                Log.info("");
            }
            if (command.getHelp() != null) {
                Log.info(command.getHelp());
            }
            Collection<HelpExample> examples = command.getExamples();
            if (examples != null) {
                Log.info(examples.size() == 1 ? "example:" : "examples:");
                Log.info("");
                for (HelpExample example : examples) {
                    Log.info("    " + example.getDescription() + ":");
                    Log.info("        $ " + example.getExample());
                    Log.info("");
                }
                Log.info("");
            }
            return ExitStatus.OK;
        }
    }
    throw new NoSuchCommandException(commandName);
}
项目:contestparser    文件:InitCommand.java   
@Override
public Collection<HelpExample> getExamples() {
    List<HelpExample> examples = new ArrayList<HelpExample>();
    examples.add(new HelpExample("To list all the capabilities of the service",
            "spring init --list"));
    examples.add(new HelpExample("To creates a default project", "spring init"));
    examples.add(new HelpExample("To create a web my-app.zip",
            "spring init -d=web my-app.zip"));
    examples.add(new HelpExample("To create a web/data-jpa gradle project unpacked",
            "spring init -d=web,jpa --build=gradle my-dir"));
    return examples;
}
项目:contestparser    文件:HelpCommand.java   
@Override
public ExitStatus run(String... args) throws Exception {
    if (args.length == 0) {
        throw new NoHelpCommandArgumentsException();
    }
    String commandName = args[0];
    for (Command command : this.commandRunner) {
        if (command.getName().equals(commandName)) {
            Log.info(this.commandRunner.getName() + command.getName() + " - "
                    + command.getDescription());
            Log.info("");
            if (command.getUsageHelp() != null) {
                Log.info("usage: " + this.commandRunner.getName() + command.getName()
                        + " " + command.getUsageHelp());
                Log.info("");
            }
            if (command.getHelp() != null) {
                Log.info(command.getHelp());
            }
            Collection<HelpExample> examples = command.getExamples();
            if (examples != null) {
                Log.info(examples.size() == 1 ? "example:" : "examples:");
                Log.info("");
                for (HelpExample example : examples) {
                    Log.info("    " + example.getDescription() + ":");
                    Log.info("        $ " + example.getExample());
                    Log.info("");
                }
                Log.info("");
            }
            return ExitStatus.OK;
        }
    }
    throw new NoSuchCommandException(commandName);
}
项目:spring-cloud-cli    文件:LauncherCommand.java   
@Override
public Collection<HelpExample> getExamples() {
    return EXAMPLES;
}