summaryrefslogtreecommitdiffstats
path: root/tools/ideviceenterrecovery.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/ideviceenterrecovery.c')
-rw-r--r--tools/ideviceenterrecovery.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/ideviceenterrecovery.c b/tools/ideviceenterrecovery.c
index 868ee7d..8d82929 100644
--- a/tools/ideviceenterrecovery.c
+++ b/tools/ideviceenterrecovery.c
@@ -23,6 +23,8 @@
23#include <config.h> 23#include <config.h>
24#endif 24#endif
25 25
26#define TOOL_NAME "ideviceenterrecovery"
27
26#include <stdio.h> 28#include <stdio.h>
27#include <string.h> 29#include <string.h>
28#include <errno.h> 30#include <errno.h>
@@ -46,6 +48,7 @@ static void print_usage(int argc, char **argv)
46 printf("OPTIONS:\n"); 48 printf("OPTIONS:\n");
47 printf(" -d, --debug\t\tenable communication debugging\n"); 49 printf(" -d, --debug\t\tenable communication debugging\n");
48 printf(" -h, --help\t\tprints usage information\n"); 50 printf(" -h, --help\t\tprints usage information\n");
51 printf(" -v, --version\t\tprints version information\n");
49 printf("\n"); 52 printf("\n");
50 printf("Homepage: <" PACKAGE_URL ">\n"); 53 printf("Homepage: <" PACKAGE_URL ">\n");
51 printf("Bug Reports: <" PACKAGE_BUGREPORT ">\n"); 54 printf("Bug Reports: <" PACKAGE_BUGREPORT ">\n");
@@ -73,6 +76,10 @@ int main(int argc, char *argv[])
73 print_usage(argc, argv); 76 print_usage(argc, argv);
74 return 0; 77 return 0;
75 } 78 }
79 else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) {
80 printf("%s %s\n", TOOL_NAME, PACKAGE_VERSION);
81 return 0;
82 }
76 } 83 }
77 84
78 i--; 85 i--;
@@ -88,7 +95,7 @@ int main(int argc, char *argv[])
88 return -1; 95 return -1;
89 } 96 }
90 97
91 if (LOCKDOWN_E_SUCCESS != (ldret = lockdownd_client_new(device, &client, "ideviceenterrecovery"))) { 98 if (LOCKDOWN_E_SUCCESS != (ldret = lockdownd_client_new(device, &client, TOOL_NAME))) {
92 printf("ERROR: Could not connect to lockdownd, error code %d\n", ldret); 99 printf("ERROR: Could not connect to lockdownd, error code %d\n", ldret);
93 idevice_free(device); 100 idevice_free(device);
94 return -1; 101 return -1;