diff --git a/src/mod-manager.ts b/src/mod-manager.ts index 80f3fd7..ac4edad 100644 --- a/src/mod-manager.ts +++ b/src/mod-manager.ts @@ -17,6 +17,7 @@ import MigrateCommand from "./commands/migrate_command.js"; import ModrinthSource from "./mods/sources/modrinth_source.js"; import Mods from "./mods/mods.js"; import {CurseforgeSource} from "./mods/sources/curseforge_source.js"; +import MinecraftUtils from "./util/minecraft_utils.js"; export default class ModManager { public static logger: Logger | null = null; @@ -40,14 +41,16 @@ export default class ModManager { new MigrateCommand() ]; - static init() { + static async init() { if (Initialiser.isInitialised()) { this.logger = ModManager.createLogger(); } this.program .name('mod-manager') - .description('A package (mod) manager for Fabric Minecraft Servers'); + .description('A package (mod) manager for Fabric Minecraft Servers') + .version(`Minecraft server version: ${await MinecraftUtils.getCurrentMinecraftVersion()}`, "-v, --version", "Reports the version of the Minecraft server"); + for (const command of this.subcommands) { command.registerCommand(this.program); @@ -58,6 +61,7 @@ export default class ModManager { this.program.showSuggestionAfterError(); this.program.showHelpAfterError(); + this.program.parse(); }