mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2024-12-21 16:28:10 +01:00
Added CLI option to list supported server versions
This commit is contained in:
parent
7807407402
commit
71180e59fe
@ -186,6 +186,7 @@ public class ViaProxyConfig {
|
||||
public void loadFromArguments(final String[] args) throws Exception {
|
||||
final OptionParser optionParser = new OptionParser();
|
||||
final OptionSpec<Void> optionHelp = optionParser.accepts("help").forHelp();
|
||||
final OptionSpec<Void> optionListVersions = optionParser.accepts("list-versions", "Lists all supported server/target versions").forHelp();
|
||||
|
||||
final Map<OptionSpec<Object>, ConfigOption> optionMap = new HashMap<>();
|
||||
final Stack<SectionIndex> 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")) {
|
||||
|
Loading…
Reference in New Issue
Block a user