From 0d016b88727db5a861830f57eb57bf2184131f98 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 11:31:25 -0400 Subject: [PATCH 1/5] Update cli.cpp --- src/cli.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cli.cpp b/src/cli.cpp index 80fe38f..b2ce5bb 100644 --- a/src/cli.cpp +++ b/src/cli.cpp @@ -61,6 +61,7 @@ void CLI::showHelp(char *argv[]) { fmt::print("\t-s --serial\tspecifies a serial to use in the product ID (defaults to random, BINK1998 only)\n"); fmt::print("\t-u --upgrade\tspecifies the Product Key will be an \"Upgrade\" version\n"); fmt::print("\t-V --validate\tproduct key to validate signature\n"); + fmt::print("\t-N --nonewline\tdisables newlines (for easier embedding in other apps)\n"); fmt::print("\n"); } From 09842ace12a6af26b5a3b9f415231ec8aec7ada9 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 11:37:38 -0400 Subject: [PATCH 2/5] Update cli.h --- src/cli.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cli.h b/src/cli.h index 43b329d..0c80bf7 100644 --- a/src/cli.h +++ b/src/cli.h @@ -67,6 +67,7 @@ struct Options { bool help; bool error; bool list; + bool nonewlines; MODE applicationMode; ACTIVATION_ALGORITHM activationMode; From 21bac3b66c9230df0411231917585383b93e8573 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 11:37:41 -0400 Subject: [PATCH 3/5] 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: From 12e511b3a5817c03721fccf2ff4ae0df3893f066 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 11:39:22 -0400 Subject: [PATCH 4/5] Update cli.cpp --- src/cli.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cli.cpp b/src/cli.cpp index 63ac32e..8a7825d 100644 --- a/src/cli.cpp +++ b/src/cli.cpp @@ -61,7 +61,7 @@ void CLI::showHelp(char *argv[]) { fmt::print("\t-s --serial\tspecifies a serial to use in the product ID (defaults to random, BINK1998 only)\n"); fmt::print("\t-u --upgrade\tspecifies the Product Key will be an \"Upgrade\" version\n"); fmt::print("\t-V --validate\tproduct key to validate signature\n"); - fmt::print("\t-N --nonewline\tdisables newlines (for easier embedding in other apps)\n"); + fmt::print("\t-N --nonewlines\tdisables newlines (for easier embedding in other apps)\n"); fmt::print("\n"); } @@ -450,7 +450,7 @@ int CLI::BINK1998Generate() { if (this->options.verbose) { fmt::print("\nSuccess count: {}/{}", this->count, this->total); } - if (this->options.nonewline == false) { + if (this->options.nonewlines == false) { fmt::print("\n"); } return 0; @@ -498,7 +498,7 @@ int CLI::BINK2002Generate() { if (this->options.verbose) { fmt::print("\nSuccess count: {}/{}", this->count, this->total); } - if (this->options.nonewline == false) { + if (this->options.nonewlines == false) { fmt::print("\n"); } @@ -574,7 +574,7 @@ int CLI::ConfirmationID() { case SUCCESS: fmt::print(confirmation_id); - if (this->options.nonewline == false) { + if (this->options.nonewlines == false) { fmt::print("\n"); } return 0; From 3ae078e3c56e6f3b94e0df04892e9d48870d41dc Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 11:53:09 -0400 Subject: [PATCH 5/5] update arg from nonewline to nonewlines --- src/cli.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli.cpp b/src/cli.cpp index 8a7825d..56dbf8e 100644 --- a/src/cli.cpp +++ b/src/cli.cpp @@ -195,7 +195,7 @@ int CLI::parseCommandLine(int argc, char* argv[], Options* options) { options->applicationMode = MODE_BINK1998_VALIDATE; i++; - } else if (arg == "-N" || arg == "--nonewline") { + } else if (arg == "-N" || arg == "--nonewlines") { options->nonewlines = true; } else { options->error = true;