cmdopts: Add a -?/--help option

This commit is contained in:
2025-01-05 13:35:14 -04:00
parent 77a19deb8e
commit 00ce114d40
3 changed files with 15 additions and 7 deletions
+5 -2
View File
@@ -15,11 +15,14 @@ try {
options.parseArguments(argc, argv);
}
catch (const std::invalid_argument& e) {
std::cerr << e.what() << std::endl;
std::cerr << options.getUsage() << std::endl;
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();
}
catch (...) {