diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp index 28249e7bd3e..7e57034881f 100644 --- a/src/frontend/mame/clifront.cpp +++ b/src/frontend/mame/clifront.cpp @@ -68,6 +68,7 @@ #define CLICOMMAND_VERIFYSOFTWARE "verifysoftware" #define CLICOMMAND_GETSOFTLIST "getsoftlist" #define CLICOMMAND_VERIFYSOFTLIST "verifysoftlist" +#define CLICOMMAND_VERSION "version" // command options #define CLIOPTION_DTD "dtd" @@ -111,6 +112,7 @@ const options_entry cli_option_entries[] = { CLICOMMAND_VERIFYSOFTWARE ";vsoft", "0", OPTION_COMMAND, "verify known software for the system" }, { CLICOMMAND_GETSOFTLIST ";glist", "0", OPTION_COMMAND, "retrieve software list by name" }, { CLICOMMAND_VERIFYSOFTLIST ";vlist", "0", OPTION_COMMAND, "verify software list by name" }, + { CLICOMMAND_VERSION, "0", OPTION_COMMAND, "get MAME version" }, { nullptr, nullptr, OPTION_HEADER, "FRONTEND COMMAND OPTIONS" }, { CLIOPTION_DTD, "1", OPTION_BOOLEAN, "include DTD in XML output" }, @@ -1415,6 +1417,17 @@ void cli_frontend::verifysoftlist(const std::vector &args) } } + +//------------------------------------------------- +// version - emit MAME version to stdout +//------------------------------------------------- + +void cli_frontend::version(const std::vector &args) +{ + osd_printf_info("%s", emulator_info::get_build_version()); +} + + //------------------------------------------------- // romident - identify ROMs by looking for // matches in our internal database @@ -1571,7 +1584,8 @@ const cli_frontend::info_command_struct *cli_frontend::find_command(const std::s { CLICOMMAND_VERIFYSOFTWARE, 0, 1, &cli_frontend::verifysoftware, "[system name|*]" }, { CLICOMMAND_ROMIDENT, 1, 1, &cli_frontend::romident, "(file or directory path)" }, { CLICOMMAND_GETSOFTLIST, 0, 1, &cli_frontend::getsoftlist, "[system name|*]" }, - { CLICOMMAND_VERIFYSOFTLIST, 0, 1, &cli_frontend::verifysoftlist, "[system name|*]" } + { CLICOMMAND_VERIFYSOFTLIST, 0, 1, &cli_frontend::verifysoftlist, "[system name|*]" }, + { CLICOMMAND_VERSION, 0, 0, &cli_frontend::version, "" } }; for (const auto &info_command : s_info_commands) diff --git a/src/frontend/mame/clifront.h b/src/frontend/mame/clifront.h index e05467bc627..84157f2a6d8 100644 --- a/src/frontend/mame/clifront.h +++ b/src/frontend/mame/clifront.h @@ -65,6 +65,7 @@ private: void romident(const std::vector &args); void getsoftlist(const std::vector &args); void verifysoftlist(const std::vector &args); + void version(const std::vector &args); // internal helpers template void apply_action(const std::vector &args, T &&drvact, U &&devact);