--help string is now shared between lime_qt and lime_sdl

This commit is contained in:
OpenSauce04 2024-10-22 21:00:39 +01:00
parent e19e3b62c3
commit afb14047e5
3 changed files with 23 additions and 30 deletions

19
src/lime/common_strings.h Normal file
View File

@ -0,0 +1,19 @@
#include <string>
namespace Common {
constexpr char help_string[] =
"Usage: {} [options] <file path>\n"
"-d, --dump-video [path] Dump video recording of emulator playback to the given file path\n"
"-f, --fullscreen Start in fullscreen mode\n"
"-g, --gdbport [port] Enable gdb stub on the given port\n"
"-h, --help Display this help and exit\n"
"-i, --install [path] Install a CIA file at the given path\n"
"-p, --movie-play [path] Play a TAS movie located at the given path\n"
"-r, --movie-record [path] Record a TAS movie to the given file path\n"
"-a, --movie-record-author [author] Set the author for the recorded TAS movie (to be used alongside --movie-record)\n"
"-n Load the lightweight SDL frontend instead of the usual Qt frontend\n"
"-m, --multiplayer [nick:password@address:port] Nickname, password, address and port for multiplayer\n"
"-v, --version Output version information and exit\n"
"-w, --windowed Start in windowed mode";
}

View File

@ -44,6 +44,7 @@
#include "common/memory_detect.h"
#include "common/scm_rev.h"
#include "common/scope_exit.h"
#include "lime/common_strings.h"
#include "lime_qt/aboutdialog.h"
#include "lime_qt/applets/mii_selector.h"
#include "lime_qt/applets/swkbd.h"
@ -218,23 +219,7 @@ GMainWindow::GMainWindow(Core::System& system_)
}
if (args[i] == QStringLiteral("--help") || args[i] == QStringLiteral("-h")) {
const std::string help_string =
std::string("Usage: ") + args[0].toStdString() +
" [options] <file path>\n"
"-d, --dump-video [path] Dump video recording of emulator playback to the "
"given file path\n"
"-f, --fullscreen Start in fullscreen mode\n"
"-g, --gdbport [port] Enable gdb stub on the given port\n"
"-h, --help Display this help and exit\n"
"-i, --install [path] Install a CIA file at the given path\n"
"-p, --movie-play [path] Play a TAS movie located at the given path\n"
"-r, --movie-record [path] Record a TAS movie to the given file path\n"
"-a, --movie-record-author [author] Set the author for the recorded TAS "
"movie (to be used alongside --movie-record)\n"
"-v, --version Output version information and exit\n"
"-w, --windowed Start in windowed mode";
ShowCommandOutput("Help", help_string);
ShowCommandOutput("Help", fmt::format(Common::help_string, args[0].toStdString()));
exit(0);
}

View File

@ -40,6 +40,7 @@
#include "core/hle/service/cfg/cfg.h"
#include "core/movie.h"
#include "input_common/main.h"
#include "lime/common_strings.h"
#include "network/network.h"
#include "video_core/gpu.h"
#include "video_core/renderer_base.h"
@ -67,19 +68,7 @@ __declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001;
#endif
static void PrintHelp(const char* argv0) {
std::cout << "Usage: " << argv0
<< " [options] <filename>\n"
"-g, --gdbport=NUMBER Enable gdb stub on port NUMBER\n"
"-i, --install=FILE Installs a specified CIA file\n"
"-m, --multiplayer=nick:password@address:port"
" Nickname, password, address and port for multiplayer\n"
"-r, --movie-record=[file] Record a movie (game inputs) to the given file\n"
"-a, --movie-record-author=AUTHOR Sets the author of the movie to be recorded\n"
"-p, --movie-play=[file] Playback the movie (game inputs) from the given file\n"
"-d, --dump-video=[file] Dumps audio and video to the given video file\n"
"-f, --fullscreen Start in fullscreen mode\n"
"-h, --help Display this help and exit\n"
"-v, --version Output version information and exit\n";
std::cout << fmt::format(Common::help_string, argv0);
}
static void PrintVersion() {