Rename the Yerbacon::exit function to Yerbacon::fail
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
de2259b6ed
commit
beb28ef4ad
@ -44,14 +44,14 @@ namespace Yerbacon {
|
||||
" Compiler: " YBCON_COMPILER "\n"
|
||||
" C++ standard: " make_string(__cplusplus);
|
||||
}
|
||||
static void exit(const std::initializer_list<const char*> reason) {
|
||||
static void fail(const std::initializer_list<const char*> reason) {
|
||||
std::for_each(reason.begin(), reason.end(), [](const char* current_string){
|
||||
std::cout << current_string;
|
||||
});
|
||||
std::cout << std::endl;
|
||||
std::exit(EXIT_FAILURE);
|
||||
}
|
||||
inline void exit(const char* reason) { exit({reason}); }
|
||||
inline void fail(const char* reason) { fail({reason}); }
|
||||
class Exception: public std::exception {
|
||||
std::string exceptionCause;
|
||||
public:
|
||||
|
@ -157,7 +157,7 @@ shared_ptr<Target> Target::forName(string_view name, const bool newLines = true)
|
||||
case PY: ADDTARGET(PY_HPP); break;
|
||||
#endif
|
||||
case NONE:
|
||||
default: Yerbacon::exit({"\"", string(1, (char) toupper(name.at(1))).data(), name.substr(2).data(), "\" is not a valid target."});
|
||||
default: Yerbacon::fail({"\"", string(1, (char) toupper(name.at(1))).data(), name.substr(2).data(), "\" is not a valid target."});
|
||||
}
|
||||
#undef ADDTARGET
|
||||
#undef make_nonlocal_task
|
||||
|
@ -23,7 +23,7 @@ int main(int argc, char* argv[]) {
|
||||
else if (currentArg == ArgumentAssignable("target")) {
|
||||
const string_view value = ArgumentAssignable::getValueFor(currentArg);
|
||||
if (not value.empty()) (target = '.') += value;
|
||||
else Yerbacon::exit("No target was provided.");
|
||||
else Yerbacon::fail("No target was provided.");
|
||||
}
|
||||
else if (currentArg == Argument("parallel")) parallel = true;
|
||||
else if (currentArg == ArgumentAssignable("newlines")) {
|
||||
@ -43,7 +43,7 @@ int main(int argc, char* argv[]) {
|
||||
cout << Yerbacon::getBuildInfo();
|
||||
} else goto invalid_argument;
|
||||
cout << '\n'; exit(EXIT_SUCCESS);
|
||||
} else invalid_argument: Yerbacon::exit({"\"", currentArg.data(), "\" is not a valid argument."});
|
||||
} else invalid_argument: Yerbacon::fail({"\"", currentArg.data(), "\" is not a valid argument."});
|
||||
}
|
||||
}
|
||||
const auto currentTarget = Target::forName(target, newLines);
|
||||
|
Loading…
Reference in New Issue
Block a user