Handle duplicated --printresult arguments.

This commit is contained in:
Username404-59 2021-07-08 16:40:47 +02:00
parent 84b2d8812c
commit 6c62ee9f1a
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 6 additions and 1 deletions

View File

@ -18,7 +18,12 @@ int main(int argc, char* argv[]) {
for (signed int i = 0; i < argc; ++i)
{
currentArg = static_cast<string_view>(argv[i]);
if ((currentArg == "--printresult") || (currentArg == "-p")) printResult = true;
if ((currentArg == "--printresult") || (currentArg == "-p")) {
if (printResult) {
cout << "ERROR: --printresult was specified two times" << '\n';
exit(EXIT_SUCCESS);
} else printResult = true;
}
else if (currentArg.starts_with("--target=")) {
currentArg.remove_prefix(9);
(target = '.') += currentArg;