WindowsXPKg/src/main.cpp

40 lines
792 B
C++
Raw Normal View History

2023-06-01 16:09:22 +03:00
//
// Created by Andrew on 01/06/2023.
//
#include "header.h"
2023-06-07 22:23:59 +03:00
#include "cli.h"
2023-06-01 16:09:22 +03:00
Options options;
int main(int argc, char *argv[]) {
2023-06-07 22:23:59 +03:00
if (!CLI::parseCommandLine(argc, argv, &options)) {
fmt::print("error parsing command line options\n");
2023-06-07 22:23:59 +03:00
CLI::showHelp(argv);
return !options.error ? 0 : 1;
}
json keys;
2023-06-07 22:23:59 +03:00
int status = CLI::validateCommandLine(&options, argv, &keys);
if (status > 0) {
return status;
}
2023-06-07 22:23:59 +03:00
CLI* run = new CLI(options, keys);
2023-06-01 16:09:22 +03:00
2023-06-07 22:23:59 +03:00
switch(options.applicationMode) {
case MODE_BINK1998:
return run->BINK1998();
2023-06-07 22:23:59 +03:00
case MODE_BINK2002:
return run->BINK2002();
2023-06-07 22:23:59 +03:00
case MODE_CONFIRMATION_ID:
return run->ConfirmationID();
2023-06-07 22:23:59 +03:00
default:
return 1;
}
2023-06-04 16:32:05 +03:00
}