Added --version

This commit is contained in:
Scoopta 2019-12-16 23:55:48 -08:00
parent 0458f06afe
commit d699827c65
7 changed files with 18 additions and 7 deletions

View File

@ -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 ' '

View File

@ -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 ' '

View File

@ -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 ' '

View File

@ -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 ' '

View File

@ -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 ' '

View File

@ -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 ' '

View File

@ -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;
}
}