diff --git a/src/wte.c b/src/wte.c index 42a1a3d..3c784ce 100644 --- a/src/wte.c +++ b/src/wte.c @@ -11,9 +11,18 @@ static int get_proposition() int main(const int argc, const char **argv) { - if (2 == argc) { - if ('-' == argv[1][0] && 'h' == argv[1][1] && '\0' == argv[1][2]) { + int ret = 1; + if (2 == argc && '-' == argv[1][0]) { + if ('h' == argv[1][1] && '\0' == argv[1][2]) { printf("wte - what to eat\na simple decision making tool for food\nuse without options\n"); + } else if ('a' == argv[1][1] && '\0' == argv[1][2]) { + ret = insert_choice(); + } else if ('d' == argv[1][1] && '\0' == argv[1][2]) { + ret = remove_choice(); + } else if ('c' == argv[1][1] && '\0' == argv[1][2]) { + ret = create_data_dir(); + } else if ('x' == argv[1][1] && '\0' == argv[1][2]) { + ret = remove_data_dir(); } else { printf("unrecognized option, try %s -h\n", *argv); } @@ -25,5 +34,5 @@ int main(const int argc, const char **argv) exit_main: - return 0; + return ret; }