diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 19d3778f071..7588ab25f89 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -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") diff --git a/doc/docportal/advanced_topics/command_line.rst b/doc/docportal/advanced_topics/command_line.rst index 46595cfa546..9ce114386e1 100755 --- a/doc/docportal/advanced_topics/command_line.rst +++ b/doc/docportal/advanced_topics/command_line.rst @@ -157,6 +157,7 @@ Short options are listed where they are available. ``--render-mode=MODE``,,":ref:`Enables additional render modes `" ``--save-slot=NUM``,``-x``,"Specifies the saved game slot to load (default: autosave)" ``--savepath=PATH``,,":ref:`Specifies path to where saved games are stored `" + ``--screenshotpath=PATH``,,"Specify path where screenshot files are created (SDL backend only)" ``--sfx-volume=NUM``,``-s``,":ref:`Sets the sfx volume `, 0-255 (default: 192)" ``--soundfont=FILE``,,":ref:`Selects the SoundFont for MIDI playback. `. Only supported by some MIDI drivers." ``--speech-volume=NUM``,``-r``,":ref:`Sets the speech volume `, 0-255 (default: 192)"