summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2014-03-27 10:23:22 +0100
committerGravatar Martin Szulecki2014-03-27 10:23:22 +0100
commitc92b4f59aba053a3df1ae67c49403122650ad996 (patch)
tree422e35b17b4d9ca7ca256d63eb16b579f4a89802 /src/main.c
parent249ab2aee2c9692895d0adb676e22c592ea457a2 (diff)
downloadusbmuxd-c92b4f59aba053a3df1ae67c49403122650ad996.tar.gz
usbmuxd-c92b4f59aba053a3df1ae67c49403122650ad996.tar.bz2
Add "--version" option to print version number and exit, useful for bug reports
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index d8dabee..252023d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -357,6 +357,7 @@ static void usage()
printf(" \t\tconnected (must be in udev mode).\n");
printf(" -X, --force-exit\tTell a running instance to exit, even if there are still\n");
printf(" \tdevices connected (always works).\n");
+ printf(" -V, --version\t\tPrint version information and exit.\n");
printf("\n");
}
@@ -370,6 +371,7 @@ static void parse_opts(int argc, char **argv)
{"udev", 0, NULL, 'u'},
{"exit", 0, NULL, 'x'},
{"force-exit", 0, NULL, 'X'},
+ {"version", 0, NULL, 'V'},
{NULL, 0, NULL, 0}
};
int c;
@@ -390,6 +392,9 @@ static void parse_opts(int argc, char **argv)
case 'v':
++verbose;
break;
+ case 'V':
+ printf("%s\n", PACKAGE_STRING);
+ exit(0);
case 'U':
drop_privileges = 1;
drop_user = optarg;