aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author7415963987456321 <tetenhop@gmail.com>2019-05-10 00:21:17 +0000
committer7415963987456321 <tetenhop@gmail.com>2019-05-10 00:21:17 +0000
commit9fc019cd41612d3c991ee580c44d6b219fdfcdb6 (patch)
tree0667d46d7b90f7d0b9b51cfd8105ca11c03e1302 /src
parente278e289896c7effb283c6b29c52b918d70251b7 (diff)
downloadimv-9fc019cd41612d3c991ee580c44d6b219fdfcdb6.tar.gz
Add version flag with -v
Diffstat (limited to 'src')
-rw-r--r--src/imv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/imv.c b/src/imv.c
index 24054da..a49804f 100644
--- a/src/imv.c
+++ b/src/imv.c
@@ -644,7 +644,7 @@ bool imv_parse_args(struct imv *imv, int argc, char **argv)
int o;
- while((o = getopt(argc, argv, "frdwWxhlu:s:n:b:t:")) != -1) {
+ while((o = getopt(argc, argv, "frdwWxhvlu:s:n:b:t:")) != -1) {
switch(o) {
case 'f': imv->fullscreen = true; break;
case 'r': imv->recursive_load = true; break;
@@ -658,6 +658,10 @@ bool imv_parse_args(struct imv *imv, int argc, char **argv)
print_help(imv);
imv->quit = true;
return true;
+ case 'v':
+ printf("Version: %s\n", IMV_VERSION);
+ imv->quit = true;
+ return false;
case 's':
if(!parse_scaling_mode(imv, optarg)) {
fprintf(stderr, "Invalid scaling mode. Aborting.\n");