Update cli.cpp

This commit is contained in:
TheTank20 2023-09-02 11:37:41 -04:00 committed by GitHub
parent 09842ace12
commit 21bac3b66c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,6 +194,9 @@ int CLI::parseCommandLine(int argc, char* argv[], Options* options) {
options->keyToCheck = argv[i+1];
options->applicationMode = MODE_BINK1998_VALIDATE;
i++;
} 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
if (this->options.nonewline == false) {
fmt::print("\n");
#endif
}
return 0;
}
@ -496,9 +498,9 @@ int CLI::BINK2002Generate() {
if (this->options.verbose) {
fmt::print("\nSuccess count: {}/{}", this->count, this->total);
}
#ifndef _WIN32
if (this->options.nonewline == false) {
fmt::print("\n");
#endif
}
return 0;
}
@ -572,9 +574,9 @@ int CLI::ConfirmationID() {
case SUCCESS:
fmt::print(confirmation_id);
#ifndef _WIN32
if (this->options.nonewline == false) {
fmt::print("\n");
#endif
}
return 0;
default: