- // make sure file does not exist
- // however, it maybe be possible that an different error has occured (besides the file not existing)
- if (access(optarg, F_OK) == 0) {
- printf("%s already exists\n", optarg);
- return 1;
- }
- // create a file here
- board_file = fopen(optarg, "w");
- // write init stuff here
- fclose(board_file);
- printf("Successfully created %s\n", optarg);
-
- todos = malloc(0);
- todo_length = 0;
-
- break;
-
- case -1:
- case '?':
- printf("Help string\n");
- return 2;
- }
-
-
- // start ncurses
- initscr();
- cbreak();
- /* raw(); */
- noecho();
- curs_set(0);
- start_color();
-
- init_pair(1, COLOR_CYAN, COLOR_BLACK);
- init_pair(2, COLOR_BLACK, COLOR_CYAN);
-
- getmaxyx(stdscr, height, width);
- x = y = 0;
- refresh();
-
- todo_win = create_list_win(20, 40, 5, 5);
- draw_todo(todo_win, todos, todo_length);
-
- move(y,x);
- while ((ch = getch()) != 113) { // while not q
-
- // ofc the first thing we need is vim keys