diff --git a/Makefile b/Makefile index f069425..c04f396 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,13 @@ +PREFIX = /usr/local +VERSION = 0.1 + SRC = minrss.c util.c net.c xml.c OBJ = $(SRC:.c=.o) CC = cc INCS = LIBS = -lcurl -I/usr/include/libxml2 -lxml2 -lm WARN = -Wall -Wpedantic -Wextra -CFLAGS = $(LIBS) $(INCS) $(WARN) - -PREFIX = /usr/local +CFLAGS = $(LIBS) $(INCS) $(WARN) -DVERSION=\"$(VERSION)\" all: config.h minrss diff --git a/minrss.c b/minrss.c index fd8c44c..cd4f9d7 100644 --- a/minrss.c +++ b/minrss.c @@ -76,8 +76,13 @@ finish(char *url, long responseCode) } int -main() +main(int argc, char *argv[]) { + if (argc == 2 && !strcmp("-v", argv[1])) + logMsg(0, "MinRSS %s\n", VERSION); + else if (argc != 1) + logMsg(0, "Usage: minrss [-v]\n"); + unsigned int i = 0; initCurl();