SHL-8 separate hello world example

This commit is contained in:
Jarred Li
2012-04-07 19:04:53 +08:00
parent 070da47f5b
commit 09396e9421
9 changed files with 173 additions and 13 deletions

View File

@@ -1,23 +0,0 @@
package org.springframework.shell.commands;
import org.springframework.roo.shell.CliAvailabilityIndicator;
import org.springframework.roo.shell.CliCommand;
import org.springframework.roo.shell.CliOption;
import org.springframework.roo.shell.CommandMarker;
import org.springframework.stereotype.Component;
@Component
public class HelloWorldCommands implements CommandMarker {
@CliAvailabilityIndicator({"hw help"})
public boolean isCommandAvailable() {
return true;
}
@CliCommand(value = "hw echo", help = "Print a hello world message")
public void config(
@CliOption(key = { "message" }, mandatory = true, help = "The hello world message") final String message) {
System.out.println("Hello world " + message);
}
}

View File

@@ -1,12 +0,0 @@
package org.springframework.shell.plugin;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan({"org.springframework.shell.commands", "org.springframework.shell.converters"})
public class HelloWorldPlugin {
}