Replace "--newlinesoff" with an assignable argument ("--newlines=on/off")

This commit is contained in:
Username404-59 2021-10-20 17:11:14 +02:00
parent 88d22e6183
commit 2cf523bf17
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 8 additions and 1 deletions

View File

@ -25,7 +25,14 @@ int main(int argc, char* argv[]) {
else Yerbacon::exit({"No target was provided."});
}
else if (currentArg == Argument("parallel")) parallel = true;
else if (currentArg == Argument("newlinesoff")) newLines = false;
else if (currentArg == ArgumentAssignable("newlines")) {
const string_view enabled = ArgumentAssignable::getValueFor(currentArg);
if (enabled == "off") {
newLines = false;
} else if (enabled == "on") {
newLines = true;
} else goto invalid_argument;
}
else if (currentArg.ends_with(".ybcon")) files.insert(currentArg);
else {
if (argc == 2) {