2025-01-04 13:21:33 -04:00
|
|
|
#include <iostream>
|
|
|
|
|
#include <exception>
|
2025-01-05 13:25:40 -04:00
|
|
|
#include <opts.h>
|
2024-09-04 14:08:50 +10:00
|
|
|
#include <mind.h>
|
2025-01-05 14:01:16 -04:00
|
|
|
#include "deviceManager/deviceManager.h"
|
2024-09-04 14:08:50 +10:00
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
|
{
|
2025-01-05 13:25:40 -04:00
|
|
|
try {
|
|
|
|
|
OptionParser options;
|
2025-01-05 14:01:16 -04:00
|
|
|
hk::Mind mind;
|
2024-09-05 18:20:33 +10:00
|
|
|
|
2025-01-05 14:01:16 -04:00
|
|
|
std::cout << PACKAGE_NAME << " " << PACKAGE_VERSION << std::endl;
|
2025-01-05 13:25:40 -04:00
|
|
|
|
2025-01-04 13:21:33 -04:00
|
|
|
try {
|
2025-01-05 13:25:40 -04:00
|
|
|
options.parseArguments(argc, argv);
|
2025-01-04 13:21:33 -04:00
|
|
|
}
|
2025-01-05 13:25:40 -04:00
|
|
|
catch (const std::invalid_argument& e) {
|
2025-01-05 14:01:16 -04:00
|
|
|
std::cerr << e.what() << '\n' << options.getUsage() << '\n';
|
2025-01-04 13:21:33 -04:00
|
|
|
return EXIT_FAILURE;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-05 13:35:14 -04:00
|
|
|
if (options.printUsage) {
|
|
|
|
|
std::cout << options.getUsage() << std::endl;
|
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
|
}
|
2025-01-05 13:25:40 -04:00
|
|
|
options.dumpOptions();
|
|
|
|
|
}
|
|
|
|
|
catch (...) {
|
2025-01-05 14:01:16 -04:00
|
|
|
std::cerr << "Unknown exception occurred" << std::endl;
|
2025-01-05 13:25:40 -04:00
|
|
|
return EXIT_FAILURE;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-05 14:01:16 -04:00
|
|
|
return 0;
|
2024-09-04 14:08:50 +10:00
|
|
|
}
|