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 @@
23#include <config.h> 23#include <config.h>
24#endif 24#endif
25 25
26#define TOOL_NAME "idevicediagnostics"
27
26#include <stdio.h> 28#include <stdio.h>
27#include <string.h> 29#include <string.h>
28#include <stdlib.h> 30#include <stdlib.h>
@@ -98,6 +100,11 @@ int main(int argc, char **argv)
98 result = EXIT_SUCCESS; 100 result = EXIT_SUCCESS;
99 goto cleanup; 101 goto cleanup;
100 } 102 }
103 else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) {
104 printf("%s %s\n", TOOL_NAME, PACKAGE_VERSION);
105 result = EXIT_SUCCESS;
106 goto cleanup;
107 }
101 else if (!strcmp(argv[i], "sleep")) { 108 else if (!strcmp(argv[i], "sleep")) {
102 cmd = CMD_SLEEP; 109 cmd = CMD_SLEEP;
103 } 110 }
@@ -193,7 +200,7 @@ int main(int argc, char **argv)
193 goto cleanup; 200 goto cleanup;
194 } 201 }
195 202
196 if (LOCKDOWN_E_SUCCESS != (ret = lockdownd_client_new_with_handshake(device, &lockdown_client, "idevicediagnostics"))) { 203 if (LOCKDOWN_E_SUCCESS != (ret = lockdownd_client_new_with_handshake(device, &lockdown_client, TOOL_NAME))) {
197 idevice_free(device); 204 idevice_free(device);
198 printf("ERROR: Could not connect to lockdownd, error code %d\n", ret); 205 printf("ERROR: Could not connect to lockdownd, error code %d\n", ret);
199 goto cleanup; 206 goto cleanup;
@@ -327,9 +334,10 @@ void print_usage(int argc, char **argv)
327 printf(" sleep\t\t\t\tput device into sleep mode (disconnects from host)\n"); 334 printf(" sleep\t\t\t\tput device into sleep mode (disconnects from host)\n");
328 printf("\n"); 335 printf("\n");
329 printf("The following OPTIONS are accepted:\n"); 336 printf("The following OPTIONS are accepted:\n");
330 printf(" -d, --debug\t\tenable communication debugging\n");
331 printf(" -u, --udid UDID\ttarget specific device by UDID\n"); 337 printf(" -u, --udid UDID\ttarget specific device by UDID\n");
338 printf(" -d, --debug\t\tenable communication debugging\n");
332 printf(" -h, --help\t\tprints usage information\n"); 339 printf(" -h, --help\t\tprints usage information\n");
340 printf(" -v, --version\t\tprints version information\n");
333 printf("\n"); 341 printf("\n");
334 printf("Homepage: <" PACKAGE_URL ">\n"); 342 printf("Homepage: <" PACKAGE_URL ">\n");
335 printf("Bug Reports: <" PACKAGE_BUGREPORT ">\n"); 343 printf("Bug Reports: <" PACKAGE_BUGREPORT ">\n");