mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
impr: Added simplified output option for --version
This commit is contained in:
@@ -30,13 +30,17 @@ namespace hex::plugin::builtin {
|
||||
using namespace hex::literals;
|
||||
|
||||
void handleVersionCommand(const std::vector<std::string> &args) {
|
||||
std::ignore = args;
|
||||
|
||||
hex::log::print(std::string(romfs::get("logo.ans").string()),
|
||||
ImHexApi::System::getImHexVersion().get(),
|
||||
ImHexApi::System::getCommitBranch(), ImHexApi::System::getCommitHash(),
|
||||
__DATE__, __TIME__,
|
||||
ImHexApi::System::isPortableVersion() ? "Portable" : "Installed");
|
||||
if (args.empty()) {
|
||||
hex::log::print(std::string(romfs::get("logo.ans").string()),
|
||||
ImHexApi::System::getImHexVersion().get(),
|
||||
ImHexApi::System::getCommitBranch(), ImHexApi::System::getCommitHash(),
|
||||
__DATE__, __TIME__,
|
||||
ImHexApi::System::isPortableVersion() ? "Portable" : "Installed");
|
||||
} else if (args.size() == 1 && args[0] == "plain") {
|
||||
hex::log::print("{}", ImHexApi::System::getImHexVersion().get());
|
||||
} else {
|
||||
std::exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
std::exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user