-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathmain.cpp
More file actions
57 lines (53 loc) · 1.59 KB
/
Copy pathmain.cpp
File metadata and controls
57 lines (53 loc) · 1.59 KB
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
48
49
50
51
52
53
54
55
56
57
#include "main.h"
#include "program/gitinfo.h"
using namespace std;
static void printHelp() {
cout << "Available subcommands:" << endl;
cout << "evalSgf" << endl;
cout << "gtp" << endl;
cout << "match" << endl;
cout << "selfPlay" << endl;
cout << "runTests" << endl;
cout << "runSearchTests" << endl;
cout << "writeSearchValueTimeseries" << endl;
cout << "sandbox" << endl;
cout << "version" << endl;
}
int main(int argc, const char* argv[]) {
if(argc < 2) {
printHelp();
return 0;
}
string cmdArg = string(argv[1]);
if(cmdArg == "-h" || cmdArg == "--h" || cmdArg == "-help" || cmdArg == "--help" || cmdArg == "help") {
printHelp();
return 0;
}
if(cmdArg == "evalSgf")
return MainCmds::evalSgf(argc-1,&argv[1]);
else if(cmdArg == "gtp")
return MainCmds::gtp(argc-1,&argv[1]);
else if(cmdArg == "match")
return MainCmds::match(argc-1,&argv[1]);
else if(cmdArg == "selfPlay")
return MainCmds::selfPlay(argc-1,&argv[1]);
else if(cmdArg == "runTests")
return MainCmds::runTests(argc-1,&argv[1]);
else if(cmdArg == "runSearchTests")
return MainCmds::runSearchTests(argc-1,&argv[1]);
else if(cmdArg == "writeSearchValueTimeseries")
return MainCmds::writeSearchValueTimeseries(argc-1,&argv[1]);
else if(cmdArg == "sandbox")
return MainCmds::sandbox();
else if(cmdArg == "version") {
cout << "Git revision: " << GIT_REVISION << endl;
cout << "Compile Time: " << __DATE__ << " " << __TIME__ << endl;
return 0;
}
else {
cout << "Unknown subcommand: " << cmdArg << endl;
printHelp();
return 1;
}
return 0;
}