mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-25 11:34:55 +00:00
fixup2
This commit is contained in:
parent
d81ae42b51
commit
1aa39e23c0
14
src/main.cpp
14
src/main.cpp
@ -32,10 +32,11 @@ int main(int argc, char* argv[]) {
|
||||
std::vector<std::string> game_args{};
|
||||
|
||||
// Map of argument strings to lambda functions
|
||||
std::unordered_map<std::string, std::function<void(int&)>> arg_map =
|
||||
{ {"-h",
|
||||
std::unordered_map<std::string, std::function<void(int&)>> arg_map = {
|
||||
{"-h",
|
||||
[&](int&) {
|
||||
std::cout << "Usage: shadps4 [options] <elf or eboot.bin path>\n"
|
||||
std::cout
|
||||
<< "Usage: shadps4 [options] <elf or eboot.bin path>\n"
|
||||
"Options:\n"
|
||||
" -g, --game <path|ID> Specify game path to launch\n"
|
||||
" -- ... Parameters passed to the game ELF. "
|
||||
@ -89,7 +90,8 @@ int main(int argc, char* argv[]) {
|
||||
} else if (f_param == "false") {
|
||||
is_fullscreen = false;
|
||||
} else {
|
||||
std::cerr << "Error: Invalid argument for -f/--fullscreen. Use 'true' or 'false'.\n";
|
||||
std::cerr
|
||||
<< "Error: Invalid argument for -f/--fullscreen. Use 'true' or 'false'.\n";
|
||||
exit(1);
|
||||
}
|
||||
// Set fullscreen mode without saving it to config file
|
||||
@ -114,7 +116,7 @@ int main(int argc, char* argv[]) {
|
||||
Config::save(Common::FS::GetUserPath(Common::FS::PathType::UserDir) / "config.toml");
|
||||
std::cout << "Game folder successfully saved.\n";
|
||||
exit(0);
|
||||
},
|
||||
}},
|
||||
{"--set-addon-folder", [&](int& i) {
|
||||
if (++i >= argc) {
|
||||
std::cerr << "Error: Missing argument for --add-addon-folder\n";
|
||||
@ -132,7 +134,7 @@ int main(int argc, char* argv[]) {
|
||||
Config::save(Common::FS::GetUserPath(Common::FS::PathType::UserDir) / "config.toml");
|
||||
std::cout << "Addon folder successfully saved.\n";
|
||||
exit(0);
|
||||
}};
|
||||
}}};
|
||||
|
||||
if (argc == 1) {
|
||||
int dummy = 0; // one does not simply pass 0 directly
|
||||
|
Loading…
Reference in New Issue
Block a user