Joedb 9.6.2
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
main_wrapper.cpp
Go to the documentation of this file.
2
3#include <iostream>
4
5namespace joedb
6{
7 /// Process command-line arguments and catch exceptions from main
8 ///
9 /// This function is particularly necessary in Windows, because no
10 /// exception information is printed by default there.
12 (
13 int (*main)(Arguments &), int argc, char **argv
14 )
15 {
16 try
17 {
18 Arguments arguments(argc, argv);
19 return main(arguments);
20 }
21 catch (const std::exception &e)
22 {
23 std::cerr << "Exception caught: " << e.what() << '\n';
24 return 1;
25 }
26 }
27}
Class for conveniently parsing command-line arguments.
Definition Arguments.h:19
int main()
int main_wrapper(int(*main)(Arguments &), int argc, char **argv)
Process command-line arguments and catch exceptions from main.
Definition Blob.h:7