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 @@
24#include <config.h> 24#include <config.h>
25#endif 25#endif
26 26
27#define TOOL_NAME "idevicebackup"
28
27#include <stdio.h> 29#include <stdio.h>
28#include <string.h> 30#include <string.h>
29#include <errno.h> 31#include <errno.h>
@@ -606,7 +608,7 @@ static void do_post_notification(const char *notification)
606 np_client_t np; 608 np_client_t np;
607 609
608 if (!client) { 610 if (!client) {
609 if (lockdownd_client_new_with_handshake(device, &client, "idevicebackup") != LOCKDOWN_E_SUCCESS) { 611 if (lockdownd_client_new_with_handshake(device, &client, TOOL_NAME) != LOCKDOWN_E_SUCCESS) {
610 return; 612 return;
611 } 613 }
612 } 614 }
@@ -673,9 +675,10 @@ static void print_usage(int argc, char **argv)
673 printf(" restore\tRestores a device backup from DIRECTORY.\n"); 675 printf(" restore\tRestores a device backup from DIRECTORY.\n");
674 printf("\n"); 676 printf("\n");
675 printf("OPTIONS:\n"); 677 printf("OPTIONS:\n");
676 printf(" -d, --debug\t\tenable communication debugging\n");
677 printf(" -u, --udid UDID\ttarget specific device by UDID\n"); 678 printf(" -u, --udid UDID\ttarget specific device by UDID\n");
679 printf(" -d, --debug\t\tenable communication debugging\n");
678 printf(" -h, --help\t\tprints usage information\n"); 680 printf(" -h, --help\t\tprints usage information\n");
681 printf(" -v, --version\t\tprints version information\n");
679 printf("\n"); 682 printf("\n");
680 printf("Homepage: <" PACKAGE_URL ">\n"); 683 printf("Homepage: <" PACKAGE_URL ">\n");
681 printf("Bug Reports: <" PACKAGE_BUGREPORT ">\n"); 684 printf("Bug Reports: <" PACKAGE_BUGREPORT ">\n");
@@ -730,6 +733,10 @@ int main(int argc, char *argv[])
730 print_usage(argc, argv); 733 print_usage(argc, argv);
731 return 0; 734 return 0;
732 } 735 }
736 else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) {
737 printf("%s %s\n", TOOL_NAME, PACKAGE_VERSION);
738 return 0;
739 }
733 else if (!strcmp(argv[i], "backup")) { 740 else if (!strcmp(argv[i], "backup")) {
734 cmd = CMD_BACKUP; 741 cmd = CMD_BACKUP;
735 } 742 }
@@ -792,7 +799,7 @@ int main(int argc, char *argv[])
792 } 799 }
793 } 800 }
794 801
795 if (LOCKDOWN_E_SUCCESS != (ldret = lockdownd_client_new_with_handshake(device, &client, "idevicebackup"))) { 802 if (LOCKDOWN_E_SUCCESS != (ldret = lockdownd_client_new_with_handshake(device, &client, TOOL_NAME))) {
796 printf("ERROR: Could not connect to lockdownd, error code %d\n", ldret); 803 printf("ERROR: Could not connect to lockdownd, error code %d\n", ldret);
797 idevice_free(device); 804 idevice_free(device);
798 return -1; 805 return -1;