-
Notifications
You must be signed in to change notification settings - Fork 831
/
Copy pathmain.cpp
43 lines (36 loc) · 1.03 KB
/
main.cpp
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
#include <cstdint>
#include <cinttypes>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include "base/log.h"
#include "golem.h"
#include "json_parser.h"
using namespace agora;
using namespace agora::base;
using namespace agora::pstn;
void print_usage() {
const char *usage =
"Golem --global_settings <string> --golem_settings <string>\n"
"OPTIONS:\n"
" --global_settings String which specify the global settings with json format\n"
" --golem_settings string which specify the golem settings with json format\n";
std::cerr << usage << std::endl;
}
int main(int argc, char *argv[]) {
std::cout << std::endl;
if(argc != 5 ||
std::string("--global_settings") != std::string(argv[1]) ||
std::string(argv[2]).empty() ||
std::string("--golem_settings") != std::string(argv[3]) ||
std::string(argv[4]).empty()
)
{
std::cerr << "Illegal arguments\n";
print_usage();
return -1;
}
golem Golem(json_parser(argv[2], argv[4]).get_settings());
return Golem.run();
}