Files
salmanoff/main.cpp
T
hayodea 6307d2869e DeviceManager: Initial class with DeviceSpecParser
Hopefully by the end of tonight we should be done with the dev
spec parser.
2025-01-05 14:19:53 -04:00

38 lines
750 B
C++

#include <iostream>
#include <exception>
#include <opts.h>
#include <mind.h>
#include <deviceManager/deviceManager.h>
int main(int argc, char **argv)
{
try {
OptionParser options;
hk::Mind mind;
std::cout << PACKAGE_NAME << " " << PACKAGE_VERSION << std::endl;
try {
options.parseArguments(argc, argv);
}
catch (const std::invalid_argument& e) {
std::cerr << e.what() << '\n' << options.getUsage() << '\n';
return EXIT_FAILURE;
}
if (options.printUsage) {
std::cout << options.getUsage() << std::endl;
return EXIT_SUCCESS;
}
options.dumpOptions();
DeviceManager::getInstance().handleDeviceSpecifiers(options);
}
catch (...) {
std::cerr << "Unknown exception occurred" << std::endl;
return EXIT_FAILURE;
}
return 0;
}