X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fxdcc%2Fui%2Fstdin%2FCommandReader.java;h=eaaef2389c127b747548799928e681b3b2431710;hb=52be4d6d0bf21502d301814ba88735fd72a3f284;hp=2ef14d7224098db6594f6aa2cc9c3c8e8a66e4a2;hpb=d3a8f3edb125265c6feb8b0ccfaa035497c07f15;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 2ef14d7..eaaef23 100644 --- a/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java +++ b/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java @@ -169,9 +169,15 @@ public class CommandReader extends AbstractExecutionThreadService { } writeLine("End of connections."); } else if (words[0].equalsIgnoreCase("disconnect")) { - Integer index = Ints.tryParse(words[1]); - if ((index != null) && (index < lastConnections.size())) { - core.closeConnection(lastConnections.get(index)); + if ((words.length == 1) || ("all".equals(words[1]))) { + for (Connection connection : lastConnections) { + core.closeConnection(connection); + } + } else { + Integer index = Ints.tryParse(words[1]); + if ((index != null) && (index < lastConnections.size())) { + core.closeConnection(lastConnections.get(index)); + } } }