8 bool file_exists(const char* file_name) {
9 ifstream test_file(file_name);
10 return (bool)test_file;
13 int main(int argc, char** argv) {
15 // read command line args
17 cout << "Taskasaur options\n-o [board_name]\n-n [new_board+name]";
22 while ((flag = getopt(argc, argv, "o:n:")) != -1) {
25 char* file_name = optarg;
26 printf("Opening %s\n", file_name);
28 // check if file exists
29 if (!file_exists(file_name)) {
30 printf("%s does not exist.\n", file_name);
34 } else if (flag == 'n') {
36 char* new_file_name = optarg;
37 printf("Creating %s\n", new_file_name);
39 if (file_exists(new_file_name)) {
40 printf("The board %s already exist.\n", new_file_name);
45 new_file.open(new_file_name);
46 new_file << "# Taskasaur\n";
61 init_pair(1, COLOR_CYAN, COLOR_BLACK);
62 init_pair(2, COLOR_BLACK, COLOR_CYAN);
65 getmaxyx(stdscr, height, width);
67 WINDOW * win = newwin(10,20,5,10);
68 WINDOW * todo_win = newwin(20,20,5,35);
69 WINDOW * bottombar = newwin(1,width,height-1,0);
75 string todo_list[3] = {"Contemplate life", "Question life", "Ponder about life"};
80 //ofc the first thing we need is vim keys
95 if (ch == 113) break; // q for quit
98 wattron(win,COLOR_PAIR(1));
100 mvwprintw(win, 0, 1, "lmao");
101 wattroff(win, A_BOLD);
102 wattroff(win,COLOR_PAIR(1));
103 mvwprintw(win, 1, 2, "poopoopeepee");
106 for (int i = 0; i < sizeof(todo_list)/sizeof(string); i++) {
107 mvwprintw(todo_win, 2*i, 0, todo_list[i].c_str());
111 wbkgd(bottombar, COLOR_PAIR(2));
112 mvwprintw(bottombar, 0, 2, "BOTTOM TEXT");