in ratis-logservice/src/main/java/org/apache/ratis/logservice/shell/LogServiceShell.java [60:97]
public void run() {
while (true) {
// Read and sanitize the input
String line;
try {
line = lineReader.readLine(PROMPT);
} catch (UserInterruptException e) {
continue;
} catch (EndOfFileException e) {
break;
}
if (line == null) {
continue;
}
line = line.trim();
// Construct the Command and args to pass to that command
Entry<Command,String[]> pair = parseCommand(line);
if (pair == null) {
continue;
}
Command command = pair.getKey();
String[] commandArgs = pair.getValue();
// Our "exit" or "quit"
if (command instanceof ExitCommand) {
break;
}
// Run the command
command.run(terminal, lineReader, client, commandArgs);
// Flush a newline to the screen.
terminal.writer().flush();
}
terminal.writer().println("Bye!");
terminal.writer().flush();
}