-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
41 lines (28 loc) · 839 Bytes
/
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
#include "funcs/create.hpp"
#include "funcs/build.hpp"
#include "funcs/helpers.hpp"
#include "funcs/run.hpp"
int main(int args_c, char* args[]) {
if (args_c < 2) {
help::logger::exitWithError("[err] No such command available\n\tuse: buildc help");
}
string cmd(args[1]);
if (cmd == "create") {
if (args_c != 4)
help::logger::exitWithError("[err] Wrong cmd\n\t> buildc create <project_name> <project_lang: c|cpp>");
create(args[2], args[3]);
}
else if (cmd == "build")
build();
else if (cmd == "run")
run();
else if (cmd == "help")
help::helpMsg();
else if (cmd == "try") {
build();
run();
}
else
help::logger::exitWithError("[err] No such command available\n\tuse: buildc help");
return 0;
}