-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
47 lines (40 loc) · 892 Bytes
/
main.cpp
File metadata and controls
47 lines (40 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#define GSL_THROW_ON_CONTRACT_VIOLATION
#include "application.h"
#include "logger.h"
#include "Data/math_util.h"
using namespace vis;
int main(int argc, char* argv[])
{
auto project_path = "data";
if(argc == 2)
{
if(std::string{argv[1]} == std::string{"-h"})
{
std::cout << "Usage: " << argv[0] << " [DATA LOCATION]\n"
<< "If no directory is specified, \"./data\" will be assumed"
<< std::endl;
return 0;
}
else
project_path = argv[1];
}
else if(argc > 2)
{
std::cerr << "Usage: " << argv[0] << " [DATA LOCATION]\n"
<< "If no directory is specified, \"./data\" will be assumed"
<< std::endl;
return -1;
}
try
{
// Data root directory
auto app = Application{project_path};
app.execute();
}
catch(std::exception& e)
{
Logger::error() << "Terminating program due to exception: " << e.what();
return -1;
}
return 0;
}