Raphael Fleischer
Raphael Fleischer

Reputation: 21

Spring Shell: how to execute commands immediately after starting interactive mode

Before I work in interactive mode I like to run some commands, e.g. 'help', 'clear' or 'my-command1'. Afterwards I would like to continue working in interactive mode.

With version 2 it worked fine for me via 'org.springframework.shell.Shell#evaluate'.

@Component
@Order(-100)
@RequiredArgsConstructor
public class MyApplicationRunner implements ApplicationRunner {

    private final Shell shell;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        shell.evaluate(() -> "help");
    }
}

My problem with version 3: 'evaluate(org.springframework.shell.Input)' has protected access in 'org.springframework.shell.Shell'

What is the recommended way from version 3?

Upvotes: 2

Views: 249

Answers (0)

Related Questions