BASE: Add command line option to set screenshot path

Note that since the ConfMan transient domain is cleared when opening
the launcher, this only work when specifying a game on the command
line as well, and only until returning to the launcher.
This commit is contained in:
Thierry Crozat 2022-01-31 20:29:01 +00:00
parent f8d69272db
commit 54c84b8700
2 changed files with 11 additions and 0 deletions

View file

@ -98,6 +98,7 @@ static const char HELP_STRING[] =
" -c, --config=CONFIG Use alternate configuration file\n"
#if defined(SDL_BACKEND)
" -l, --logfile=PATH Use alternate path for log file\n"
" --screenshotpath=PATH Specify path where screenshot files are created\n"
#endif
" -p, --path=PATH Path to where the game is installed\n"
" -x, --save-slot[=NUM] Save game slot to load (default: autosave)\n"
@ -597,6 +598,15 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha
#if defined(SDL_BACKEND)
DO_OPTION('l', "logfile")
END_OPTION
DO_LONG_OPTION("screenshotpath")
Common::FSNode path(option);
if (!path.exists()) {
usage("Non-existent game path '%s'", option);
} else if (!path.isWritable()) {
usage("Non-writable screenshot path '%s'", option);
}
END_OPTION
#endif
DO_OPTION_INT('b', "boot-param")