From 894d38730fb4153d280fa989517082d300033fc4 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Wed, 11 Nov 2015 20:40:59 +0000 Subject: Print version information in help --- Makefile | 4 ++++ src/main.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 00c009f..5fe15ff 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,10 @@ BUILDDIR = build SOURCES = $(wildcard src/*.c) OBJECTS = $(patsubst src/%.c,$(BUILDDIR)/%.o,$(SOURCES)) +VERSION = "v0.1.0" + +CFLAGS += -DIMV_VERSION=\"$(VERSION)\" + $(TARGET): $(OBJECTS) @echo "LINKING $@" @$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) diff --git a/src/main.c b/src/main.c index a7b115c..571e476 100644 --- a/src/main.c +++ b/src/main.c @@ -37,6 +37,7 @@ struct { void print_usage(const char* name) { fprintf(stdout, + "imv %s\n" "Usage: %s [-ifsh] [images...]\n" "\n" "Flags:\n" @@ -67,7 +68,7 @@ void print_usage(const char* name) " 'f': Toggle fullscreen\n" " ' ': Toggle gif playback\n" " '.': Step a frame of gif playback\n" - ,name); + , IMV_VERSION, name); } void parse_arg(const char* name, const char* arg) -- cgit v1.2.3