mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-09-27 06:42:42 +02:00
Add version flag for cli (#414)
* Add version flag for cli, rename mc-version flag * Change to -V, revert mc-version
This commit is contained in:
parent
f2355fa99b
commit
0fce08dd62
@ -41,6 +41,7 @@
|
|||||||
import de.bluecolored.bluemap.common.web.*;
|
import de.bluecolored.bluemap.common.web.*;
|
||||||
import de.bluecolored.bluemap.common.web.http.HttpRequestHandler;
|
import de.bluecolored.bluemap.common.web.http.HttpRequestHandler;
|
||||||
import de.bluecolored.bluemap.common.web.http.HttpServer;
|
import de.bluecolored.bluemap.common.web.http.HttpServer;
|
||||||
|
import de.bluecolored.bluemap.core.BlueMap;
|
||||||
import de.bluecolored.bluemap.core.MinecraftVersion;
|
import de.bluecolored.bluemap.core.MinecraftVersion;
|
||||||
import de.bluecolored.bluemap.core.logger.Logger;
|
import de.bluecolored.bluemap.core.logger.Logger;
|
||||||
import de.bluecolored.bluemap.core.logger.LoggerLogger;
|
import de.bluecolored.bluemap.core.logger.LoggerLogger;
|
||||||
@ -272,6 +273,12 @@ public static void main(String[] args) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//version
|
||||||
|
if (cmd.hasOption("V")) {
|
||||||
|
BlueMapCLI.printVersion();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//config folder
|
//config folder
|
||||||
cli.configFolder = Path.of("config");
|
cli.configFolder = Path.of("config");
|
||||||
if (cmd.hasOption("c")) {
|
if (cmd.hasOption("c")) {
|
||||||
@ -381,7 +388,7 @@ private static Options createOptions() {
|
|||||||
Option.builder("v")
|
Option.builder("v")
|
||||||
.longOpt("mc-version")
|
.longOpt("mc-version")
|
||||||
.hasArg()
|
.hasArg()
|
||||||
.argName("version")
|
.argName("mc-version")
|
||||||
.desc("Sets the minecraft-version, used e.g. to load resource-packs correctly. Defaults to the latest compatible version.")
|
.desc("Sets the minecraft-version, used e.g. to load resource-packs correctly. Defaults to the latest compatible version.")
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
@ -407,6 +414,8 @@ private static Options createOptions() {
|
|||||||
|
|
||||||
options.addOption("u", "watch", false, "Watches for file-changes after rendering and updates the map");
|
options.addOption("u", "watch", false, "Watches for file-changes after rendering and updates the map");
|
||||||
|
|
||||||
|
options.addOption("V", "version", false, "Print the current BlueMap version");
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,4 +454,8 @@ private static void printHelp() {
|
|||||||
|
|
||||||
formatter.printHelp(command + " [options]", "\nOptions:", createOptions(), "\n" + footer);
|
formatter.printHelp(command + " [options]", "\nOptions:", createOptions(), "\n" + footer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void printVersion() {
|
||||||
|
System.out.printf("%s\n%s\n", BlueMap.VERSION, BlueMap.GIT_HASH);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user