about summary refs log tree commit diff stats
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..fe12ea5 --- /dev/null +++ b/main.cpp
@@ -0,0 +1,32 @@
1#include "cadence.h"
2#include <iostream>
3
4int main(int argc, char** argv)
5{
6 std::random_device randomDevice;
7 std::mt19937 rng(randomDevice());
8
9 if (argc != 2)
10 {
11 std::cout << "usage: cadence [configfile]" << std::endl;
12 return -1;
13 }
14
15 std::string configfile(argv[1]);
16
17 try
18 {
19 cadence bot(configfile, rng);
20
21 try
22 {
23 bot.run();
24 } catch (const std::exception& ex)
25 {
26 std::cout << "Error running bot: " << ex.what() << std::endl;
27 }
28 } catch (const std::exception& ex)
29 {
30 std::cout << "Error initializing bot: " << ex.what() << std::endl;
31 }
32}