This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Shell 4.0.1!spring-doc.cn

Reading Input

When you need to read input from the shell in your command implementation, you can do it by using the InputReader obtained from the command context:spring-doc.cn

@Command
public void example(CommandContext ctx) throws Exception {
	String name = ctx.inputReader().readInput("Enter your name: ");
	char[] chars = ctx.inputReader().readPassword("Enter new password: ");
	// do something with name and password
}