mirror of
https://github.com/N64Recomp/N64Recomp.git
synced 2026-03-21 17:34:35 -05:00
Make arg parsing more generic and fix running with no args
Some checks failed
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (blaze/ubuntu-22.04, Debug) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (blaze/ubuntu-22.04, Release) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (macos-14, Debug) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (macos-14, Release) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (macos-15-intel, Debug) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (macos-15-intel, Release) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (ubuntu-latest, Debug) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (ubuntu-latest, Release) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (windows-latest, Debug) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (windows-latest, Release) (push) Has been cancelled
Some checks failed
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (blaze/ubuntu-22.04, Debug) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (blaze/ubuntu-22.04, Release) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (macos-14, Debug) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (macos-14, Release) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (macos-15-intel, Debug) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (macos-15-intel, Release) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (ubuntu-latest, Debug) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (ubuntu-latest, Release) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (windows-latest, Debug) (push) Has been cancelled
validate / ${{ matrix.os }} (${{ (matrix.os == 'macos-14' || matrix.os == 'blaze/ubuntu-22.04') && 'arm64' || 'x64' }}, ${{ matrix.type }}) (windows-latest, Release) (push) Has been cancelled
This commit is contained in:
parent
f14ffe6064
commit
0fab168437
26
src/main.cpp
26
src/main.cpp
|
|
@ -272,22 +272,26 @@ int main(int argc, char** argv) {
|
|||
std::exit(EXIT_FAILURE);
|
||||
};
|
||||
|
||||
bool dumping_context;
|
||||
bool dumping_context = false;
|
||||
|
||||
if (argc >= 3) {
|
||||
std::string arg2 = argv[2];
|
||||
if (arg2 == "--dump-context") {
|
||||
dumping_context = true;
|
||||
} else {
|
||||
fmt::print("Usage: {} <config file> [--dump-context]\n", argv[0]);
|
||||
std::exit(EXIT_SUCCESS);
|
||||
}
|
||||
} else {
|
||||
dumping_context = false;
|
||||
if (argc < 2) {
|
||||
fmt::print("Usage: {} <config file> [--dump-context]\n", argv[0]);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
const char* config_path = argv[1];
|
||||
|
||||
for (size_t i = 2; i < argc; i++) {
|
||||
std::string_view cur_arg = argv[i];
|
||||
if (cur_arg == "--dump-context") {
|
||||
dumping_context = true;
|
||||
}
|
||||
else {
|
||||
fmt::print("Unknown argument \"{}\"\n", cur_arg);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
N64Recomp::Config config{ config_path };
|
||||
if (!config.good()) {
|
||||
exit_failure(fmt::format("Failed to load config file: {}\n", config_path));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user