-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
61 lines (57 loc) · 1.64 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "include/terminal.h"
#include "include/csvparser.h"
#include "modes/clock.h"
#include "modes/csv.h"
int main(int argc, const char **argv)
{
bool paramMode = false;
std::string mode;
if (containsArg(argc, argv, "--no-start"))
{
paramMode = true;
std::cout << "\t\033[32mStarting...\033[0m" << std::endl;
usleep(1000000);
}
else
{
paramMode = false;
std::string bars = repeat("=", (getWindowSize()[0] / 2) - 9);
std::cout << "\033[36m\033[?25h" + bars + "||\033[31mTerminalDrawer\033[36m||" + bars + "\033[0m" << std::endl;
std::cout << "\t Welcome to \033[1mTerminalDrawer\033[0m" << std::endl;
std::cout << "" << std::endl;
std::cout << "\t Would you like to start the draw process? \033[93m(this will clear the terminal!)\033[0m (Y/N)";
char startDrawer;
std::cin >> startDrawer;
if (startDrawer == 'Y' or startDrawer == 'y')
{
std::cout << "\t What mode would you like to start in?\033[0m (csv, clock)";
std::cin >> mode;
std::cout << "\t\033[32mStarting...\033[0m" << std::endl;
usleep(1000000);
}
else
{
return 0;
}
}
if (paramMode)
{
if (containsArg(argc, argv, "--csv"))
{
csvDrawer(argc, argv);
}
if (containsArg(argc, argv, "--clock"))
{
clockDrawer(argc, argv);
}
} else {
if (mode == "csv")
{
csvDrawer(argc, argv);
}
if (mode == "clock")
{
clockDrawer(argc, argv);
}
}
}