mirror of
https://github.com/Neo-Desktop/WindowsXPKg
synced 2024-12-22 12:30:17 +02:00
Merge pull request #68 from UMSKT/newline-fix
This commit is contained in:
commit
214d2d38a5
27
src/cli.cpp
27
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-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-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-V --validate\tproduct key to validate signature\n");
|
||||||
|
fmt::print("\t-N --nonewlines\tdisables newlines (for easier embedding in other apps)\n");
|
||||||
fmt::print("\n");
|
fmt::print("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,13 +82,13 @@ int CLI::parseCommandLine(int argc, char* argv[], Options* options) {
|
|||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
|
false,
|
||||||
MODE_BINK1998_GENERATE,
|
MODE_BINK1998_GENERATE,
|
||||||
WINDOWS
|
WINDOWS
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 1; i < argc; i++) {
|
for (int i = 1; i < argc; i++) {
|
||||||
std::string arg = argv[i];
|
std::string arg = argv[i];
|
||||||
|
|
||||||
if (arg == "-v" || arg == "--verbose") {
|
if (arg == "-v" || arg == "--verbose") {
|
||||||
options->verbose = true;
|
options->verbose = true;
|
||||||
UMSKT::setDebugOutput(stderr);
|
UMSKT::setDebugOutput(stderr);
|
||||||
@ -193,7 +194,10 @@ int CLI::parseCommandLine(int argc, char* argv[], Options* options) {
|
|||||||
options->keyToCheck = argv[i+1];
|
options->keyToCheck = argv[i+1];
|
||||||
options->applicationMode = MODE_BINK1998_VALIDATE;
|
options->applicationMode = MODE_BINK1998_VALIDATE;
|
||||||
i++;
|
i++;
|
||||||
} else {
|
|
||||||
|
} else if (arg == "-N" || arg == "--nonewlines") {
|
||||||
|
options->nonewlines = true;
|
||||||
|
} else {
|
||||||
options->error = true;
|
options->error = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -446,10 +450,9 @@ int CLI::BINK1998Generate() {
|
|||||||
if (this->options.verbose) {
|
if (this->options.verbose) {
|
||||||
fmt::print("\nSuccess count: {}/{}", this->count, this->total);
|
fmt::print("\nSuccess count: {}/{}", this->count, this->total);
|
||||||
}
|
}
|
||||||
#ifndef _WIN32
|
if (this->options.nonewlines == false) {
|
||||||
fmt::print("\n");
|
fmt::print("\n");
|
||||||
#endif
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -495,9 +498,9 @@ int CLI::BINK2002Generate() {
|
|||||||
if (this->options.verbose) {
|
if (this->options.verbose) {
|
||||||
fmt::print("\nSuccess count: {}/{}", this->count, this->total);
|
fmt::print("\nSuccess count: {}/{}", this->count, this->total);
|
||||||
}
|
}
|
||||||
#ifndef _WIN32
|
if (this->options.nonewlines == false) {
|
||||||
fmt::print("\n");
|
fmt::print("\n");
|
||||||
#endif
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -571,9 +574,9 @@ int CLI::ConfirmationID() {
|
|||||||
|
|
||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
fmt::print(confirmation_id);
|
fmt::print(confirmation_id);
|
||||||
#ifndef _WIN32
|
if (this->options.nonewlines == false) {
|
||||||
fmt::print("\n");
|
fmt::print("\n");
|
||||||
#endif
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user