4141import de .bluecolored .bluemap .common .web .*;
4242import de .bluecolored .bluemap .common .web .http .HttpRequestHandler ;
4343import de .bluecolored .bluemap .common .web .http .HttpServer ;
44+ import de .bluecolored .bluemap .core .BlueMap ;
4445import de .bluecolored .bluemap .core .MinecraftVersion ;
4546import de .bluecolored .bluemap .core .logger .Logger ;
4647import de .bluecolored .bluemap .core .logger .LoggerLogger ;
@@ -272,6 +273,12 @@ public static void main(String[] args) {
272273 return ;
273274 }
274275
276+ //version
277+ if (cmd .hasOption ("V" )) {
278+ BlueMapCLI .printVersion ();
279+ return ;
280+ }
281+
275282 //config folder
276283 cli .configFolder = Path .of ("config" );
277284 if (cmd .hasOption ("c" )) {
@@ -381,7 +388,7 @@ private static Options createOptions() {
381388 Option .builder ("v" )
382389 .longOpt ("mc-version" )
383390 .hasArg ()
384- .argName ("version" )
391+ .argName ("mc- version" )
385392 .desc ("Sets the minecraft-version, used e.g. to load resource-packs correctly. Defaults to the latest compatible version." )
386393 .build ()
387394 );
@@ -407,6 +414,8 @@ private static Options createOptions() {
407414
408415 options .addOption ("u" , "watch" , false , "Watches for file-changes after rendering and updates the map" );
409416
417+ options .addOption ("V" , "version" , false , "Print the current BlueMap version" );
418+
410419 return options ;
411420 }
412421
@@ -445,4 +454,8 @@ private static void printHelp() {
445454
446455 formatter .printHelp (command + " [options]" , "\n Options:" , createOptions (), "\n " + footer );
447456 }
457+
458+ private static void printVersion () {
459+ System .out .printf ("%s\n %s\n " , BlueMap .VERSION , BlueMap .GIT_HASH );
460+ }
448461}
0 commit comments