summaryrefslogtreecommitdiffstats
path: root/tools/idevicenotificationproxy.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/idevicenotificationproxy.c')
-rw-r--r--tools/idevicenotificationproxy.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/idevicenotificationproxy.c b/tools/idevicenotificationproxy.c
index 45744bc..15b63a3 100644
--- a/tools/idevicenotificationproxy.c
+++ b/tools/idevicenotificationproxy.c
@@ -23,6 +23,8 @@
#include <config.h>
#endif
+#define TOOL_NAME "idevicenotificationproxy"
+
#include <stdio.h>
#include <string.h>
#include <errno.h>
@@ -71,9 +73,10 @@ static void print_usage(int argc, char **argv)
printf(" observe ID [...]\tobserve notification IDs in the foreground until CTRL+C or signal is received\n");
printf("\n");
printf("The following OPTIONS are accepted:\n");
- printf(" -d, --debug\t\tenable communication debugging\n");
printf(" -u, --udid UDID\ttarget specific device by UDID\n");
+ printf(" -d, --debug\t\tenable communication debugging\n");
printf(" -h, --help\t\tprints usage information\n");
+ printf(" -v, --version\t\tprints version information\n");
printf("\n");
printf("Homepage: <" PACKAGE_URL ">\n");
printf("Bug Reports: <" PACKAGE_BUGREPORT ">\n");
@@ -130,6 +133,11 @@ int main(int argc, char *argv[])
result = 0;
goto cleanup;
}
+ else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) {
+ printf("%s %s\n", TOOL_NAME, PACKAGE_VERSION);
+ result = 0;
+ goto cleanup;
+ }
else if (!strcmp(argv[i], "post") || !strcmp(argv[i], "observe")) {
cmd = CMD_POST;
if (!strcmp(argv[i], "observe")) {
@@ -186,7 +194,7 @@ int main(int argc, char *argv[])
goto cleanup;
}
- if (LOCKDOWN_E_SUCCESS != (ret = lockdownd_client_new_with_handshake(device, &client, "idevicenotificationproxy"))) {
+ if (LOCKDOWN_E_SUCCESS != (ret = lockdownd_client_new_with_handshake(device, &client, TOOL_NAME))) {
fprintf(stderr, "ERROR: Could not connect to lockdownd, error code %d\n", ret);
goto cleanup;
}