cmdopts: Add a -?/--help option
This commit is contained in:
@@ -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 (...) {
|
||||
|
||||
Reference in New Issue
Block a user