diff options
| author | 2020-06-05 18:42:20 +0200 | |
|---|---|---|
| committer | 2020-06-05 18:42:20 +0200 | |
| commit | 3aa4e243faa8198550cb2851cb6f0b9cbb293812 (patch) | |
| tree | 4ea94424d60f1f2e7852f148a41eaeb7e92657a5 /tools/idevicecrashreport.c | |
| parent | a077067bf9458612d54157e3c875d065e3678a54 (diff) | |
| download | libimobiledevice-3aa4e243faa8198550cb2851cb6f0b9cbb293812.tar.gz libimobiledevice-3aa4e243faa8198550cb2851cb6f0b9cbb293812.tar.bz2 | |
tools: Add --version command line switch
Diffstat (limited to 'tools/idevicecrashreport.c')
| -rw-r--r-- | tools/idevicecrashreport.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/idevicecrashreport.c b/tools/idevicecrashreport.c index 8600ad1..0fc40c6 100644 --- a/tools/idevicecrashreport.c +++ b/tools/idevicecrashreport.c | |||
| @@ -24,6 +24,8 @@ | |||
| 24 | #include <config.h> | 24 | #include <config.h> |
| 25 | #endif | 25 | #endif |
| 26 | 26 | ||
| 27 | #define TOOL_NAME "idevicecrashreport" | ||
| 28 | |||
| 27 | #include <stdio.h> | 29 | #include <stdio.h> |
| 28 | #include <stdlib.h> | 30 | #include <stdlib.h> |
| 29 | #include <string.h> | 31 | #include <string.h> |
| @@ -306,11 +308,12 @@ static void print_usage(int argc, char **argv) | |||
| 306 | printf("Move crash reports from device to a local DIRECTORY.\n"); | 308 | printf("Move crash reports from device to a local DIRECTORY.\n"); |
| 307 | printf("\n"); | 309 | printf("\n"); |
| 308 | printf("OPTIONS:\n"); | 310 | printf("OPTIONS:\n"); |
| 311 | printf(" -u, --udid UDID\ttarget specific device by UDID\n"); | ||
| 309 | printf(" -e, --extract\t\textract raw crash report into separate '.crash' file\n"); | 312 | printf(" -e, --extract\t\textract raw crash report into separate '.crash' file\n"); |
| 310 | printf(" -k, --keep\t\tcopy but do not remove crash reports from device\n"); | 313 | printf(" -k, --keep\t\tcopy but do not remove crash reports from device\n"); |
| 311 | printf(" -d, --debug\t\tenable communication debugging\n"); | 314 | printf(" -d, --debug\t\tenable communication debugging\n"); |
| 312 | printf(" -u, --udid UDID\ttarget specific device by UDID\n"); | ||
| 313 | printf(" -h, --help\t\tprints usage information\n"); | 315 | printf(" -h, --help\t\tprints usage information\n"); |
| 316 | printf(" -v, --version\t\tprints version information\n"); | ||
| 314 | printf("\n"); | 317 | printf("\n"); |
| 315 | printf("Homepage: <" PACKAGE_URL ">\n"); | 318 | printf("Homepage: <" PACKAGE_URL ">\n"); |
| 316 | printf("Bug Reports: <" PACKAGE_BUGREPORT ">\n"); | 319 | printf("Bug Reports: <" PACKAGE_BUGREPORT ">\n"); |
| @@ -351,6 +354,10 @@ int main(int argc, char* argv[]) | |||
| 351 | print_usage(argc, argv); | 354 | print_usage(argc, argv); |
| 352 | return 0; | 355 | return 0; |
| 353 | } | 356 | } |
| 357 | else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) { | ||
| 358 | printf("%s %s\n", TOOL_NAME, PACKAGE_VERSION); | ||
| 359 | return 0; | ||
| 360 | } | ||
| 354 | else if (!strcmp(argv[i], "-e") || !strcmp(argv[i], "--extract")) { | 361 | else if (!strcmp(argv[i], "-e") || !strcmp(argv[i], "--extract")) { |
| 355 | extract_raw_crash_reports = 1; | 362 | extract_raw_crash_reports = 1; |
| 356 | continue; | 363 | continue; |
| @@ -392,7 +399,7 @@ int main(int argc, char* argv[]) | |||
| 392 | return -1; | 399 | return -1; |
| 393 | } | 400 | } |
| 394 | 401 | ||
| 395 | lockdownd_error = lockdownd_client_new_with_handshake(device, &lockdownd, "idevicecrashreport"); | 402 | lockdownd_error = lockdownd_client_new_with_handshake(device, &lockdownd, TOOL_NAME); |
| 396 | if (lockdownd_error != LOCKDOWN_E_SUCCESS) { | 403 | if (lockdownd_error != LOCKDOWN_E_SUCCESS) { |
| 397 | fprintf(stderr, "ERROR: Could not connect to lockdownd, error code %d\n", lockdownd_error); | 404 | fprintf(stderr, "ERROR: Could not connect to lockdownd, error code %d\n", lockdownd_error); |
| 398 | idevice_free(device); | 405 | idevice_free(device); |
