From 21bac3b66c9230df0411231917585383b93e8573 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 11:37:41 -0400 Subject: [PATCH] Update cli.cpp --- src/cli.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/cli.cpp b/src/cli.cpp index b2ce5bb..63ac32e 100644 --- a/src/cli.cpp +++ b/src/cli.cpp @@ -82,13 +82,13 @@ int CLI::parseCommandLine(int argc, char* argv[], Options* options) { false, false, false, + false, MODE_BINK1998_GENERATE, WINDOWS }; for (int i = 1; i < argc; i++) { std::string arg = argv[i]; - if (arg == "-v" || arg == "--verbose") { options->verbose = true; UMSKT::setDebugOutput(stderr); @@ -194,7 +194,10 @@ int CLI::parseCommandLine(int argc, char* argv[], Options* options) { options->keyToCheck = argv[i+1]; options->applicationMode = MODE_BINK1998_VALIDATE; i++; - } else { + + } else if (arg == "-N" || arg == "--nonewline") { + options->nonewlines = true; + } else { options->error = true; } } @@ -447,10 +450,9 @@ int CLI::BINK1998Generate() { if (this->options.verbose) { fmt::print("\nSuccess count: {}/{}", this->count, this->total); } -#ifndef _WIN32 - fmt::print("\n"); -#endif - + if (this->options.nonewline == false) { + fmt::print("\n"); + } return 0; } @@ -496,9 +498,9 @@ int CLI::BINK2002Generate() { if (this->options.verbose) { fmt::print("\nSuccess count: {}/{}", this->count, this->total); } -#ifndef _WIN32 - fmt::print("\n"); -#endif + if (this->options.nonewline == false) { + fmt::print("\n"); + } return 0; } @@ -572,9 +574,9 @@ int CLI::ConfirmationID() { case SUCCESS: fmt::print(confirmation_id); -#ifndef _WIN32 - fmt::print("\n"); -#endif + if (this->options.nonewline == false) { + fmt::print("\n"); + } return 0; default: