diff --git a/makefile b/makefile index 18eac52..6ef4d47 100644 --- a/makefile +++ b/makefile @@ -1,11 +1,11 @@ .PHONY: debug release run -release: src/wta.c - gcc -o build/wta -O2 -Wall -Wextra -pedantic -Werror src/wta.c +release: src/wte.c + gcc -o build/wte -O2 -Wall -Wextra -pedantic -Werror src/wte.c run: release - ./build/wta + ./build/wte -debug: src/wta.c - gcc -o build/wta -ggdb3 -DDEBUG -Wall -Wextra -pedantic -Werror src/wta.c +debug: src/wte.c + gcc -o build/wte -ggdb3 -DDEBUG -Wall -Wextra -pedantic -Werror src/wte.c diff --git a/src/wta.c b/src/wte.c similarity index 70% rename from src/wta.c rename to src/wte.c index 27fb825..c353686 100644 --- a/src/wta.c +++ b/src/wte.c @@ -7,22 +7,38 @@ #else #define dbg(format, ...) #endif + #define c_red "\033[1;31m" #define c_green "\033[1;32m" #define c_yellow "\033[1;33m" #define c_end "\033[0m" +#define error(format, ...) do {\ + fprintf(stderr, c_red "[ERROR] "format c_end"\n", __VA_ARGS__); \ +} while(0) + + +static int get_proposition() +{ + int ret = 0; + return ret; +} int main(const int argc, const char **argv) { if (2 == argc) { if ('-' == argv[1][0] && 'h' == argv[1][1] && '\0' == argv[1][2]) { - printf("wte - what to eat\na simple decision making tool for food\n"); + printf("wte - what to eat\na simple decision making tool for food\nuse without options\n"); } else { printf("unrecognized option, try %s -h\n", *argv); } goto exit_main; } + if (!get_proposition()) { + error("%s", "error"); + } + + exit_main: return 0; }