in ratis-logservice/src/main/java/org/apache/ratis/logservice/shell/LogServiceShell.java [99:116]
Entry<Command,String[]> parseCommand(String line) {
String[] words = line.split("\\s+");
if (words.length == 0) {
return null;
}
String commandWord = words[0];
Command command = CommandFactory.create(commandWord);
// If we have no command to run, return null.
if (command == null) {
return null;
}
// Pull off the "command" name
String[] args = Arrays.copyOfRange(words, 1, words.length);
return new AbstractMap.SimpleEntry<>(command, args);
}