diff options
Diffstat (limited to 'tools/idevicedate.c')
| -rw-r--r-- | tools/idevicedate.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/idevicedate.c b/tools/idevicedate.c index 9c14fdf..e1fbc20 100644 --- a/tools/idevicedate.c +++ b/tools/idevicedate.c | |||
| @@ -23,6 +23,8 @@ | |||
| 23 | #include <config.h> | 23 | #include <config.h> |
| 24 | #endif | 24 | #endif |
| 25 | 25 | ||
| 26 | #define TOOL_NAME "idevicedate" | ||
| 27 | |||
| 26 | #include <stdio.h> | 28 | #include <stdio.h> |
| 27 | #include <stdlib.h> | 29 | #include <stdlib.h> |
| 28 | #include <string.h> | 30 | #include <string.h> |
| @@ -56,11 +58,12 @@ static void print_usage(int argc, char **argv) | |||
| 56 | printf(" in the setup wizard screens before device activation.\n"); | 58 | printf(" in the setup wizard screens before device activation.\n"); |
| 57 | printf("\n"); | 59 | printf("\n"); |
| 58 | printf("OPTIONS:\n"); | 60 | printf("OPTIONS:\n"); |
| 59 | printf(" -d, --debug\t\tenable communication debugging\n"); | ||
| 60 | printf(" -u, --udid UDID\ttarget specific device by UDID\n"); | 61 | printf(" -u, --udid UDID\ttarget specific device by UDID\n"); |
| 61 | printf(" -s, --set TIMESTAMP\tset UTC time described by TIMESTAMP\n"); | 62 | printf(" -s, --set TIMESTAMP\tset UTC time described by TIMESTAMP\n"); |
| 62 | printf(" -c, --sync\t\tset time of device to current system time\n"); | 63 | printf(" -c, --sync\t\tset time of device to current system time\n"); |
| 64 | printf(" -d, --debug\t\tenable communication debugging\n"); | ||
| 63 | printf(" -h, --help\t\tprints usage information\n"); | 65 | printf(" -h, --help\t\tprints usage information\n"); |
| 66 | printf(" -v, --version\t\tprints version information\n"); | ||
| 64 | printf("\n"); | 67 | printf("\n"); |
| 65 | printf("Homepage: <" PACKAGE_URL ">\n"); | 68 | printf("Homepage: <" PACKAGE_URL ">\n"); |
| 66 | printf("Bug Reports: <" PACKAGE_BUGREPORT ">\n"); | 69 | printf("Bug Reports: <" PACKAGE_BUGREPORT ">\n"); |
| @@ -129,6 +132,10 @@ int main(int argc, char *argv[]) | |||
| 129 | print_usage(argc, argv); | 132 | print_usage(argc, argv); |
| 130 | return 0; | 133 | return 0; |
| 131 | } | 134 | } |
| 135 | else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) { | ||
| 136 | printf("%s %s\n", TOOL_NAME, PACKAGE_VERSION); | ||
| 137 | return 0; | ||
| 138 | } | ||
| 132 | else { | 139 | else { |
| 133 | print_usage(argc, argv); | 140 | print_usage(argc, argv); |
| 134 | return 0; | 141 | return 0; |
| @@ -145,7 +152,7 @@ int main(int argc, char *argv[]) | |||
| 145 | return -1; | 152 | return -1; |
| 146 | } | 153 | } |
| 147 | 154 | ||
| 148 | if (LOCKDOWN_E_SUCCESS != (ldret = lockdownd_client_new_with_handshake(device, &client, "idevicedate"))) { | 155 | if (LOCKDOWN_E_SUCCESS != (ldret = lockdownd_client_new_with_handshake(device, &client, TOOL_NAME))) { |
| 149 | fprintf(stderr, "ERROR: Could not connect to lockdownd, error code %d\n", ldret); | 156 | fprintf(stderr, "ERROR: Could not connect to lockdownd, error code %d\n", ldret); |
| 150 | result = -1; | 157 | result = -1; |
| 151 | goto cleanup; | 158 | goto cleanup; |
