mirror of
https://github.com/holub/mame
synced 2025-04-23 17:00:53 +03:00
Merge pull request #5273 from npwoods/version_cli_option
Adding a -version command line argument to get the current build version
This commit is contained in:
commit
98fe9fc693
@ -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<std::string> &args)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// version - emit MAME version to stdout
|
||||
//-------------------------------------------------
|
||||
|
||||
void cli_frontend::version(const std::vector<std::string> &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)
|
||||
|
@ -65,6 +65,7 @@ private:
|
||||
void romident(const std::vector<std::string> &args);
|
||||
void getsoftlist(const std::vector<std::string> &args);
|
||||
void verifysoftlist(const std::vector<std::string> &args);
|
||||
void version(const std::vector<std::string> &args);
|
||||
|
||||
// internal helpers
|
||||
template <typename T, typename U> void apply_action(const std::vector<std::string> &args, T &&drvact, U &&devact);
|
||||
|
Loading…
Reference in New Issue
Block a user