feat: make console prompt [server:1234] > so we can finally see the console server !!!
This commit is contained in:
@@ -44,14 +44,12 @@ public class ConsolePlugin implements Completer {
|
||||
|
||||
reader.option(LineReader.Option.DISABLE_EVENT_EXPANSION, true);
|
||||
|
||||
final String prompt = "> ";
|
||||
|
||||
final Thread thread = new Thread(
|
||||
() -> {
|
||||
while (true) {
|
||||
String line = null;
|
||||
try {
|
||||
line = reader.readLine(prompt);
|
||||
line = reader.readLine(getPrompt());
|
||||
} catch (final Exception e) {
|
||||
System.exit(1);
|
||||
}
|
||||
@@ -65,6 +63,15 @@ public class ConsolePlugin implements Completer {
|
||||
thread.start();
|
||||
}
|
||||
|
||||
private String getPrompt () {
|
||||
// [all] > input
|
||||
// [localhost:25565] > input
|
||||
return String.format(
|
||||
"[%s] > ",
|
||||
consoleServer
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void complete (final LineReader reader, final ParsedLine line, final List<Candidate> candidates) {
|
||||
if (!line.line().startsWith(prefix)) return;
|
||||
|
||||
Reference in New Issue
Block a user