2023-06-16 22:38:10 +03:00
|
|
|
/**
|
|
|
|
* This file is a part of the WindowsXPKg Project
|
|
|
|
*
|
|
|
|
* Copyleft (C) 2019-2023 WindowsXPKg Contributors (et.al.)
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* @FileCreated by Andrew on 01/06/2023
|
|
|
|
* @Maintainer Neo
|
|
|
|
*/
|
2023-06-01 16:09:22 +03:00
|
|
|
|
|
|
|
#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
|
|
|
}
|