SHL-6 - Spring Shell does not support "help"
This commit is contained in:
@@ -91,14 +91,14 @@ public class Bootstrap {
|
||||
Map<String, CommandMarker> commands = ctx.getBeansOfType(CommandMarker.class);
|
||||
|
||||
for (CommandMarker command : commands.values()) {
|
||||
System.out.println("Registgering command " + command);
|
||||
System.out.println("Registering command " + command);
|
||||
shell.getSimpleParser().add(command);
|
||||
}
|
||||
|
||||
Map<String, Converter> converters = ctx.getBeansOfType(Converter.class);
|
||||
|
||||
for (Converter converter : converters.values()) {
|
||||
System.out.println("Registgering converter " + converter);
|
||||
System.out.println("Registering converter " + converter);
|
||||
shell.getSimpleParser().add(converter);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.springframework.shell.commands;
|
||||
|
||||
import org.springframework.roo.shell.CliCommand;
|
||||
import org.springframework.roo.shell.CliOption;
|
||||
import org.springframework.roo.shell.CommandMarker;
|
||||
import org.springframework.roo.shell.SimpleParser;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Provides a listing of commands known to the shell.
|
||||
*
|
||||
* @author Ben Alex
|
||||
* @author Mark Pollack
|
||||
*
|
||||
*/
|
||||
@Component
|
||||
public class HelpCommands extends SimpleParser implements CommandMarker {
|
||||
|
||||
|
||||
// Taken from SimpleParserComponent in the Roo code base
|
||||
@Override
|
||||
@CliCommand(value = "help", help = "Shows system help")
|
||||
public void obtainHelp(
|
||||
@CliOption(key = { "", "command" }, optionContext = "availableCommands", help = "Command name to provide help for") final String buffer) {
|
||||
super.obtainHelp(buffer);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user