summaryrefslogtreecommitdiffstats
path: root/tools/idevicediagnostics.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/idevicediagnostics.c')
-rw-r--r--tools/idevicediagnostics.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/idevicediagnostics.c b/tools/idevicediagnostics.c
index 052bbed..153f9ac 100644
--- a/tools/idevicediagnostics.c
+++ b/tools/idevicediagnostics.c
@@ -23,6 +23,8 @@
#include <config.h>
#endif
+#define TOOL_NAME "idevicediagnostics"
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -98,6 +100,11 @@ int main(int argc, char **argv)
result = EXIT_SUCCESS;
goto cleanup;
}
+ else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) {
+ printf("%s %s\n", TOOL_NAME, PACKAGE_VERSION);
+ result = EXIT_SUCCESS;
+ goto cleanup;
+ }
else if (!strcmp(argv[i], "sleep")) {
cmd = CMD_SLEEP;
}
@@ -193,7 +200,7 @@ int main(int argc, char **argv)
goto cleanup;
}
- if (LOCKDOWN_E_SUCCESS != (ret = lockdownd_client_new_with_handshake(device, &lockdown_client, "idevicediagnostics"))) {
+ if (LOCKDOWN_E_SUCCESS != (ret = lockdownd_client_new_with_handshake(device, &lockdown_client, TOOL_NAME))) {
idevice_free(device);
printf("ERROR: Could not connect to lockdownd, error code %d\n", ret);
goto cleanup;
@@ -327,9 +334,10 @@ void print_usage(int argc, char **argv)
printf(" sleep\t\t\t\tput device into sleep mode (disconnects from host)\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");