Remove support for InitCommand outside REPL

In this commit we retain "init" as a command inside the ShellCommand
but not on the bash command line.

Seems to have an impact on performance so relevant to gh-212.
This commit is contained in:
Dave Syer
2014-01-14 13:27:40 +00:00
parent c43d91598e
commit 3e6eb6fec8
5 changed files with 9 additions and 17 deletions

View File

@@ -99,7 +99,7 @@ public class InitCommandTests {
@Test
public void runOptions() throws Exception {
SpringCli cli = new SpringCli();
InitCommand command = cli.getInitCommand();
InitCommand command = new InitCommand(cli);
command.run("src/test/resources/commands/options.groovy");
cli.find("foo").run("--foo=bar", "--bar=123");
assertTrue(this.output.toString().contains("Hello Foo: bar=123"));

View File

@@ -44,7 +44,7 @@ public class ScriptCommandTests {
public void init() {
this.classLoader = Thread.currentThread().getContextClassLoader();
this.cli = new SpringCli();
this.init = this.cli.getInitCommand();
this.init = new InitCommand(this.cli);
executed = false;
}