From 7b1987f81b4c14c4b446442c80b315056a25154a Mon Sep 17 00:00:00 2001 From: Username404 Date: Thu, 7 Oct 2021 20:59:46 +0200 Subject: [PATCH] Throw an exception when instead of calling exit when the "--newlinesoff" argument is used with incompatible targets --- src/headers/transpiler/Target.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/headers/transpiler/Target.hpp b/src/headers/transpiler/Target.hpp index b2338c3..0fa275e 100644 --- a/src/headers/transpiler/Target.hpp +++ b/src/headers/transpiler/Target.hpp @@ -128,8 +128,8 @@ shared_ptr Target::forName(string_view name, const bool newLines = true) } #undef ADDTARGET if (not newLines and not target->supportsOneLine()) { - cout << "--newlinesoff cannot be used with --target=" << name.substr(1) << endl; - exit(0); + name.remove_prefix(1); + throw Yerbacon::Exception(string("--newlinesoff cannot be used with --target=") += name); } return target; };