2 * @file commandline-win.cpp
3 * @brief Windows版固有実装(コマンドライン)
6 #include "main-win/commandline-win.h"
7 #include "main-win/main-win-utils.h"
8 #include "term/z-util.h"
14 CommandLine command_line{};
18 std::string savefile_option;
26 static void create_console(void)
30 freopen_s(&stream, "CONOUT$", "w+", stdout);
31 std::cout << "Hengband debug console" << std::endl;
34 void CommandLine::handle(void)
37 LPWSTR *argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
39 for (int i = 1; i < argc; i++) {
40 fwprintf(stdout, L"argv[%d] : %s\n", i, argv[i]);
41 if (wcscmp(argv[i], L"--debug-console") == 0) {
44 } else if (wcscmp(argv[i], L"--output-spoilers") == 0) {
45 create_debug_spoiler();
48 if (argv[i][0] != L'-') {
49 // "-"で始まらない最初のオプションをセーブファイル名とみなす
50 if (savefile_option.empty()) {
51 savefile_option = to_multibyte(argv[i]).c_str();
59 fprintf(stdout, "CommandLineToArgvW failed.");
64 const std::string &CommandLine::get_savefile_option(void)
66 return savefile_option;