-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.cpp
More file actions
29 lines (26 loc) · 729 Bytes
/
Copy pathmain.cpp
File metadata and controls
29 lines (26 loc) · 729 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
#include "ProgramOptions.hpp"
#include "HuaweiClient.hpp"
#include "AngularServer.hpp"
using namespace std;
int main(int argc, const char * argv[]){
ProgramOptions po(argc, argv);
if(!po.proceed){
std::cout << "exiting ... " << std::endl;
return 0;
}
HuaweiClient hc(po.server,po.user,po.password);
thread login_thread([&hc]{
cout << "Background login to: " << hc.getServer() << endl;
hc.login();
});
login_thread.detach();
AngularServer as(hc,po.port, [&po](){
std::string url="xdg-open http://localhost:";
#ifdef _WIN32
url="cmd /c start http://localhost:";
#elif __APPLE__
url="open http://localhost:";
#endif
if(!po.preventGui) system(url.append(std::to_string(po.port)).c_str());
});
}