diff --git a/Debug/modes/subdir.mk b/Debug/modes/subdir.mk index bfe0e75..eb3297d 100644 --- a/Debug/modes/subdir.mk +++ b/Debug/modes/subdir.mk @@ -23,7 +23,7 @@ C_DEPS += \ modes/%.o: ../modes/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - gcc -D_GNU_SOURCE -I../inc -O0 -g3 -Wall -Wextra -c -fmessage-length=0 -fsanitize=address `pkg-config --cflags gtk+-3.0 gio-unix-2.0` -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" + gcc -D_GNU_SOURCE -DVERSION='"'"`hg identify`"'"' -I../inc -O0 -g3 -Wall -Wextra -c -fmessage-length=0 -fsanitize=address `pkg-config --cflags gtk+-3.0 gio-unix-2.0` -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/Debug/proto/subdir.mk b/Debug/proto/subdir.mk index 81afe29..9e22e2f 100644 --- a/Debug/proto/subdir.mk +++ b/Debug/proto/subdir.mk @@ -20,7 +20,7 @@ C_DEPS += \ proto/%.o: ../proto/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - gcc -D_GNU_SOURCE -I../inc -O0 -g3 -Wall -Wextra -c -fmessage-length=0 -fsanitize=address `pkg-config --cflags gtk+-3.0 gio-unix-2.0` -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" + gcc -D_GNU_SOURCE -DVERSION='"'"`hg identify`"'"' -I../inc -O0 -g3 -Wall -Wextra -c -fmessage-length=0 -fsanitize=address `pkg-config --cflags gtk+-3.0 gio-unix-2.0` -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/Debug/src/subdir.mk b/Debug/src/subdir.mk index 20a1f06..bf92938 100644 --- a/Debug/src/subdir.mk +++ b/Debug/src/subdir.mk @@ -32,7 +32,7 @@ C_DEPS += \ src/%.o: ../src/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - gcc -D_GNU_SOURCE -I../inc -O0 -g3 -Wall -Wextra -c -fmessage-length=0 -fsanitize=address `pkg-config --cflags gtk+-3.0 gio-unix-2.0` -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" + gcc -D_GNU_SOURCE -DVERSION='"'"`hg identify`"'"' -I../inc -O0 -g3 -Wall -Wextra -c -fmessage-length=0 -fsanitize=address `pkg-config --cflags gtk+-3.0 gio-unix-2.0` -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/Release/modes/subdir.mk b/Release/modes/subdir.mk index 0d72246..a8dd98e 100644 --- a/Release/modes/subdir.mk +++ b/Release/modes/subdir.mk @@ -23,7 +23,7 @@ C_DEPS += \ modes/%.o: ../modes/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - gcc -D_GNU_SOURCE -I../inc -O3 -Wall -Wextra -c -fmessage-length=0 `pkg-config --cflags gtk+-3.0 gio-unix-2.0` -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" + gcc -D_GNU_SOURCE -DVERSION='"'"`hg identify`"'"' -I../inc -O3 -Wall -Wextra -c -fmessage-length=0 `pkg-config --cflags gtk+-3.0 gio-unix-2.0` -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/Release/proto/subdir.mk b/Release/proto/subdir.mk index 2d3277d..e7edc5a 100644 --- a/Release/proto/subdir.mk +++ b/Release/proto/subdir.mk @@ -20,7 +20,7 @@ C_DEPS += \ proto/%.o: ../proto/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - gcc -D_GNU_SOURCE -I../inc -O3 -Wall -Wextra -c -fmessage-length=0 `pkg-config --cflags gtk+-3.0 gio-unix-2.0` -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" + gcc -D_GNU_SOURCE -DVERSION='"'"`hg identify`"'"' -I../inc -O3 -Wall -Wextra -c -fmessage-length=0 `pkg-config --cflags gtk+-3.0 gio-unix-2.0` -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/Release/src/subdir.mk b/Release/src/subdir.mk index 70a6689..09713df 100644 --- a/Release/src/subdir.mk +++ b/Release/src/subdir.mk @@ -32,7 +32,7 @@ C_DEPS += \ src/%.o: ../src/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - gcc -D_GNU_SOURCE -I../inc -O3 -Wall -Wextra -c -fmessage-length=0 `pkg-config --cflags gtk+-3.0 gio-unix-2.0` -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" + gcc -D_GNU_SOURCE -DVERSION='"'"`hg identify`"'"' -I../inc -O3 -Wall -Wextra -c -fmessage-length=0 `pkg-config --cflags gtk+-3.0 gio-unix-2.0` -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/src/main.c b/src/main.c index 988b61c..0868352 100644 --- a/src/main.c +++ b/src/main.c @@ -71,6 +71,7 @@ static void print_usage(char** argv) { printf("--matching\t-M\tSets the matching method, default is contains\n"); printf("--insensitive\t-i\tAllows case insensitive searching\n"); printf("--parse-search\t-q\tParses the search text removing image escapes and pango\n"); + printf("--version\t\t-v\tPrints the version and then exits\n"); exit(0); } @@ -318,6 +319,12 @@ int main(int argc, char** argv) { .flag = NULL, .val = 'q' }, + { + .name = "version", + .has_arg = no_argument, + .flag = NULL, + .val = 'v' + }, { .name = NULL, .has_arg = 0, @@ -347,7 +354,7 @@ int main(int argc, char** argv) { char* insensitive = NULL; char* parse_search = NULL; int opt; - while((opt = getopt_long(argc, argv, "hfc:s:C:dS:W:H:p:x:y:nImk:t:P::ebM:iq", opts, NULL)) != -1) { + while((opt = getopt_long(argc, argv, "hfc:s:C:dS:W:H:p:x:y:nImk:t:P::ebM:iqv", opts, NULL)) != -1) { switch(opt) { case 'h': print_usage(argv); @@ -423,6 +430,10 @@ int main(int argc, char** argv) { case 'q': parse_search = "true"; break; + case 'v': + printf(VERSION"\n"); + exit(0); + break; } }