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
|
|
|
|
2023-06-07 01:04:39 +03:00
|
|
|
Options options;
|
2023-06-01 20:55:36 +03:00
|
|
|
|
2023-06-02 07:25:43 +03:00
|
|
|
int main(int argc, char *argv[]) {
|
2023-06-07 22:23:59 +03:00
|
|
|
if (!CLI::parseCommandLine(argc, argv, &options)) {
|
2023-06-07 01:04:39 +03:00
|
|
|
fmt::print("error parsing command line options\n");
|
2023-06-07 22:23:59 +03:00
|
|
|
CLI::showHelp(argv);
|
2023-06-05 18:43:31 +03:00
|
|
|
return !options.error ? 0 : 1;
|
2023-06-02 07:25:43 +03:00
|
|
|
}
|
|
|
|
|
2023-06-05 18:43:31 +03:00
|
|
|
json keys;
|
2023-06-07 01:04:39 +03:00
|
|
|
|
2023-06-07 22:23:59 +03:00
|
|
|
int status = CLI::validateCommandLine(&options, argv, &keys);
|
2023-06-07 01:04:39 +03:00
|
|
|
if (status > 0) {
|
|
|
|
return status;
|
2023-06-02 07:25:43 +03:00
|
|
|
}
|
|
|
|
|
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-01 22:19:35 +03:00
|
|
|
|
2023-06-07 22:23:59 +03:00
|
|
|
case MODE_BINK2002:
|
|
|
|
return run->BINK2002();
|
2023-06-01 22:19:35 +03:00
|
|
|
|
2023-06-07 22:23:59 +03:00
|
|
|
case MODE_CONFIRMATION_ID:
|
|
|
|
return run->ConfirmationID();
|
2023-06-01 22:19:35 +03:00
|
|
|
|
2023-06-07 22:23:59 +03:00
|
|
|
default:
|
|
|
|
return 1;
|
2023-06-02 07:25:43 +03:00
|
|
|
}
|
2023-06-04 16:32:05 +03:00
|
|
|
}
|