diff --git a/src/lime/common_strings.h b/src/lime/common_strings.h new file mode 100644 index 000000000..0aa343ac6 --- /dev/null +++ b/src/lime/common_strings.h @@ -0,0 +1,19 @@ +#include + +namespace Common { + +constexpr char help_string[] = + "Usage: {} [options] \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"; +} \ No newline at end of file diff --git a/src/lime_qt/lime_qt.cpp b/src/lime_qt/lime_qt.cpp index b1c8c9240..401c4a5be 100644 --- a/src/lime_qt/lime_qt.cpp +++ b/src/lime_qt/lime_qt.cpp @@ -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] \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); } diff --git a/src/lime_sdl/lime_sdl.cpp b/src/lime_sdl/lime_sdl.cpp index a46b50ec6..5fcf5ac66 100644 --- a/src/lime_sdl/lime_sdl.cpp +++ b/src/lime_sdl/lime_sdl.cpp @@ -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] \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() {