diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -75,6 +75,13 @@ void list_notes(note_list_t* list) { int main(int argc, char* argv[]) { + // Print helptext if no commands specified + if(argc == 1) { + printf("\nNo command specified. Printing help text.\n"); + get_help(); + return 1; + } + /** * Config variables */ @@ -98,7 +105,10 @@ int main(int argc, char* argv[]) { strcat(conf_path, "/.config/noteless.conf"); config_t c; - config_new(&c, conf_path); + int config_status = config_new(&c, conf_path); + if(config_status == -1) { + printf("Config file could not be found.\n"); + } // Override where notes are to be stored // The local version of note path, in case it isn't set in the config @@ -126,13 +136,6 @@ int main(int argc, char* argv[]) { editor = tmp_editor; } - // Print helptext if no commands specified - if(argc == 1) { - printf("\nNo command specified. Printing help text.\n"); - get_help(); - return 1; - } - // // If the init command was passed, we want to init before checking if the // // note path exists, otherwise the error will display and the store will // // never be initialized. @@ -193,6 +196,8 @@ int main(int argc, char* argv[]) { return 1; } + // DANGER WILL ROBINSON!!! + // Clean up note_list_free(&list); config_free(&c); |