X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fxdcc%2Fui%2Fstdin%2FCommandReader.java;h=2d0a35292a0f525fc70aba6b274dcf366b063586;hb=f44a2c07039e9f86fbc5927f6ba097d9d42b3e21;hp=e9bcc3ce8af199e61303c7ea8890f54c702c1504;hpb=7cf4d960b265bfa56af6c7abda94eaf00233c6c0;p=xudocci.git diff --git a/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java b/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java index e9bcc3c..2d0a352 100644 --- a/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java +++ b/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java @@ -63,7 +63,7 @@ public class CommandReader extends AbstractExecutionThreadService { private final BufferedReader reader; /** The writer to write the results to. */ - private final Writer writer; + private final DuplicateLineSuppressingWriter writer; private final Collection failedDownloads; /** @@ -110,6 +110,7 @@ public class CommandReader extends AbstractExecutionThreadService { if (line.equals("")) { line = lastLine; } + writer.reset(); String[] words = line.split(" +"); String commandName = words[0]; Collection eligibleCommands = findEligibleCommands(commandName); @@ -121,6 +122,7 @@ public class CommandReader extends AbstractExecutionThreadService { Command command = eligibleCommands.iterator().next(); List parameters = from(asList(words)).skip(1).toList(); state = command.execute(state, parameters, writer); + writer.flush(); } lastLine = line;