-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cc
More file actions
32 lines (27 loc) · 751 Bytes
/
main.cc
File metadata and controls
32 lines (27 loc) · 751 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
#include <iostream>
#include <cstdio>
#include <cassert>
#include "./src/interpreter/command.h"
#include "./src/interpreter/help.h"
#include "./src/api/repl.h"
using namespace std;
const string VERSION = "0.0.3";
int defaultNumBlocks = 2, defaultBlockSize = 4096;
int main(int argc, const char* argv[]) {
auto args = COMMAND::analyse(argc, argv);
// it means ./minisql
if (argc == 1) {
REPL::repl(VERSION);
}
if (argc == 2) {
if (args.find("help") != args.end()) {
HELP::help();
return 0;
} else if (args.find("file") != args.end()) {
REPL::file(args["file"]);
} else {
cout << "Error: Invalid argument." << endl;
}
}
return 0;
}