Show an error when an invalid argument is provided

This commit is contained in:
Username404 2021-09-28 21:32:37 +02:00
parent 9a27c0c9c7
commit 02e8de7243
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 4 additions and 0 deletions

View File

@ -29,6 +29,10 @@ int main(int argc, char* argv[]) {
else if (currentArg == Argument("parallel")) parallel = true;
else if (currentArg == Argument("newlinesoff")) newLines = false;
else if (currentArg.ends_with(".ybcon")) files.insert(currentArg);
else if (i > 0) {
cout << '"' << currentArg << "\" is not a valid argument." << endl;
exit(EXIT_FAILURE);
}
}
const auto compile = [&target, &newLines](string_view name) -> string {
string transpiledString = transpile(parseString(getFileContent(name.data())), target, newLines);