summaryrefslogtreecommitdiffstats
path: root/tools/idevicebackup.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/idevicebackup.c')
-rw-r--r--tools/idevicebackup.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c
index c55301c..171ab7e 100644
--- a/tools/idevicebackup.c
+++ b/tools/idevicebackup.c
@@ -24,6 +24,8 @@
#include <config.h>
#endif
+#define TOOL_NAME "idevicebackup"
+
#include <stdio.h>
#include <string.h>
#include <errno.h>
@@ -606,7 +608,7 @@ static void do_post_notification(const char *notification)
np_client_t np;
if (!client) {
- if (lockdownd_client_new_with_handshake(device, &client, "idevicebackup") != LOCKDOWN_E_SUCCESS) {
+ if (lockdownd_client_new_with_handshake(device, &client, TOOL_NAME) != LOCKDOWN_E_SUCCESS) {
return;
}
}
@@ -673,9 +675,10 @@ static void print_usage(int argc, char **argv)
printf(" restore\tRestores a device backup from DIRECTORY.\n");
printf("\n");
printf("OPTIONS:\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");
@@ -730,6 +733,10 @@ int main(int argc, char *argv[])
print_usage(argc, argv);
return 0;
}
+ else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) {
+ printf("%s %s\n", TOOL_NAME, PACKAGE_VERSION);
+ return 0;
+ }
else if (!strcmp(argv[i], "backup")) {
cmd = CMD_BACKUP;
}
@@ -792,7 +799,7 @@ int main(int argc, char *argv[])
}
}
- if (LOCKDOWN_E_SUCCESS != (ldret = lockdownd_client_new_with_handshake(device, &client, "idevicebackup"))) {
+ if (LOCKDOWN_E_SUCCESS != (ldret = lockdownd_client_new_with_handshake(device, &client, TOOL_NAME))) {
printf("ERROR: Could not connect to lockdownd, error code %d\n", ldret);
idevice_free(device);
return -1;