diff --git a/src/main/java/net/raphimc/viaproxy/protocoltranslator/viaproxy/ViaProxyConfig.java b/src/main/java/net/raphimc/viaproxy/protocoltranslator/viaproxy/ViaProxyConfig.java index 7d86753..4a3873c 100644 --- a/src/main/java/net/raphimc/viaproxy/protocoltranslator/viaproxy/ViaProxyConfig.java +++ b/src/main/java/net/raphimc/viaproxy/protocoltranslator/viaproxy/ViaProxyConfig.java @@ -186,6 +186,7 @@ public class ViaProxyConfig { public void loadFromArguments(final String[] args) throws Exception { final OptionParser optionParser = new OptionParser(); final OptionSpec optionHelp = optionParser.accepts("help").forHelp(); + final OptionSpec optionListVersions = optionParser.accepts("list-versions", "Lists all supported server/target versions").forHelp(); final Map, ConfigOption> optionMap = new HashMap<>(); final Stack stack = new Stack<>(); @@ -212,6 +213,13 @@ public class ViaProxyConfig { final OptionSet options = optionParser.parse(args); if (options.has(optionHelp)) { throw new HelpRequestedException(); + } else if (options.has(optionListVersions)) { + Logger.LOGGER.info("=== Supported Server Versions ==="); + for (ProtocolVersion version : ProtocolVersion.getProtocols()) { + Logger.LOGGER.info(version.getName()); + } + Logger.LOGGER.info("==================================="); + System.exit(0); } if (options.has("minecraft-account-index")) {