From 6c62ee9f1ad49fcc56cc282bec353157b50d4024 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Thu, 8 Jul 2021 16:40:47 +0200 Subject: [PATCH] Handle duplicated --printresult arguments. --- src/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 1440bd1..0945f56 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,7 +18,12 @@ int main(int argc, char* argv[]) { for (signed int i = 0; i < argc; ++i) { currentArg = static_cast(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;