Changed the version format and added proper handling of invalid command line arguments

This commit is contained in:
Leon Styhre 2020-05-15 18:46:06 +02:00
parent 89794a34cf
commit 4aa30017bf
4 changed files with 20 additions and 13 deletions

View file

@ -4,10 +4,10 @@
// These numbers and strings need to be manually updated for a new version.
// Do this version number update as the very last commit for the new release version.
#define PROGRAM_VERSION_MAJOR 2
#define PROGRAM_VERSION_MINOR 10
#define PROGRAM_VERSION_MAJOR 1
#define PROGRAM_VERSION_MINOR 0
#define PROGRAM_VERSION_MAINTENANCE 0
#define PROGRAM_VERSION_STRING "1.0.0DE-dev"
#define PROGRAM_VERSION_STRING "1.0.0-alpha"
#define PROGRAM_BUILT_STRING __DATE__ " - " __TIME__

View file

@ -566,7 +566,7 @@ void GuiMenu::openQuitMenu()
Scripting::fireEvent("quit", "poweroff");
Scripting::fireEvent("poweroff");
if (quitES(QuitMode::POWEROFF) != 0)
LOG(LogWarning) << "Poweroff terminated with non-zero result!";
LOG(LogWarning) << "Power off terminated with non-zero result!";
}, "NO", nullptr));
});
row.addElement(std::make_shared<TextComponent>(window, "POWER OFF SYSTEM", Font::get(FONT_SIZE_MEDIUM), 0x777777FF), true);
@ -578,11 +578,11 @@ void GuiMenu::openQuitMenu()
void GuiMenu::addVersionInfo()
{
std::string buildDate = (Settings::getInstance()->getBool("Debug") ? std::string( " (" + Utils::String::toUpper(PROGRAM_BUILT_STRING) + ")") : (""));
// std::string buildDate = (Settings::getInstance()->getBool("Debug") ? std::string( " (" + Utils::String::toUpper(PROGRAM_BUILT_STRING) + ")") : (""));
mVersion.setFont(Font::get(FONT_SIZE_SMALL));
mVersion.setColor(0x5E5E5EFF);
mVersion.setText("EMULATIONSTATION V" + Utils::String::toUpper(PROGRAM_VERSION_STRING) + buildDate);
mVersion.setText("EMULATIONSTATION-DE V" + Utils::String::toUpper(PROGRAM_VERSION_STRING));
mVersion.setHorizontalAlignment(ALIGN_CENTER);
addChild(&mVersion);
}

View file

@ -138,9 +138,9 @@ bool parseArgs(int argc, char* argv[])
bool vsync = (strcmp(argv[i + 1], "on") == 0 || strcmp(argv[i + 1], "1") == 0) ? true : false;
Settings::getInstance()->setBool("VSync", vsync);
i++; // skip vsync value
}else if(strcmp(argv[i], "--scrape") == 0)
{
scrape_cmdline = true;
// }else if(strcmp(argv[i], "--scrape") == 0)
// {
// scrape_cmdline = true;
}else if(strcmp(argv[i], "--max-vram") == 0)
{
int maxVRAM = atoi(argv[i + 1]);
@ -169,8 +169,7 @@ bool parseArgs(int argc, char* argv[])
freopen("CONOUT$", "wb", stdout);
#endif
std::cout <<
"EmulationStation, a graphical front-end for ROM browsing.\n"
"Written by Alec \"Aloshi\" Lofquist.\n"
"EmulationStation Desktop Edition, a graphical front-end for ROM browsing.\n"
"Version " << PROGRAM_VERSION_STRING << ", built " << PROGRAM_BUILT_STRING << "\n\n"
"Command line arguments:\n"
"--resolution [width] [height] Try and force a particular resolution\n"
@ -180,7 +179,7 @@ bool parseArgs(int argc, char* argv[])
"--no-exit Don't show the exit option in the menu\n"
"--no-splash Don't show the splash screen\n"
"--debug More logging, show console on Windows\n"
"--scrape Scrape using command line interface\n"
// "--scrape Scrape using command line interface\n"
"--windowed Not fullscreen, should be used with --resolution\n"
"--fullscreen-normal Run in normal fullscreen mode\n"
"--fullscreen-borderless Run in borderless fullscreen mode (always on top)\n"
@ -194,6 +193,14 @@ bool parseArgs(int argc, char* argv[])
"More information available in README.md.\n";
return false; //exit after printing help
}
else
{
std::string argv_unknown = argv[i];
std::cout << "Invalid command line argument '" << argv_unknown << "'\n";
std::cout << "Try 'emulationstation --help' for more information.\n";
return false; // exit after printing message
}
}
return true;

View file

@ -28,7 +28,7 @@ public:
const std::string API_DEV_P = { 108, 28, 54, 55, 83, 43, 91, 44, 30, 22, 41, 12, 0, 108, 38, 29 };
const std::string API_DEV_KEY = { 54, 73, 115, 100, 101, 67, 111, 107, 79, 66, 68, 66, 67, 56, 118, 77, 54, 88, 101, 54 };
const std::string API_URL_BASE = "https://www.screenscraper.fr/api2";
const std::string API_SOFT_NAME = "Emulationstation " + static_cast<std::string>(PROGRAM_VERSION_STRING);
const std::string API_SOFT_NAME = "Emulationstation-DE " + static_cast<std::string>(PROGRAM_VERSION_STRING);
/** Which type of image artwork we need. Possible values (not a comprehensive list):
- ss: in-game screenshot