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: