diff options
Diffstat (limited to 'tools/idevicesyslog.c')
| -rw-r--r-- | tools/idevicesyslog.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/idevicesyslog.c b/tools/idevicesyslog.c index 54699a0..acbcd74 100644 --- a/tools/idevicesyslog.c +++ b/tools/idevicesyslog.c | |||
| @@ -24,6 +24,8 @@ | |||
| 24 | #include "config.h" | 24 | #include "config.h" |
| 25 | #endif | 25 | #endif |
| 26 | 26 | ||
| 27 | #define TOOL_NAME "idevicesyslog" | ||
| 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> |
| @@ -408,7 +410,7 @@ static int start_logging(void) | |||
| 408 | } | 410 | } |
| 409 | 411 | ||
| 410 | lockdownd_client_t lockdown = NULL; | 412 | lockdownd_client_t lockdown = NULL; |
| 411 | lockdownd_error_t lerr = lockdownd_client_new_with_handshake(device, &lockdown, "idevicesyslog"); | 413 | lockdownd_error_t lerr = lockdownd_client_new_with_handshake(device, &lockdown, TOOL_NAME); |
| 412 | if (lerr != LOCKDOWN_E_SUCCESS) { | 414 | if (lerr != LOCKDOWN_E_SUCCESS) { |
| 413 | fprintf(stderr, "ERROR: Could not connect to lockdownd: %d\n", lerr); | 415 | fprintf(stderr, "ERROR: Could not connect to lockdownd: %d\n", lerr); |
| 414 | idevice_free(device); | 416 | idevice_free(device); |
| @@ -528,6 +530,7 @@ static void print_usage(int argc, char **argv, int is_error) | |||
| 528 | " -x, --exit exit when device disconnects\n" \ | 530 | " -x, --exit exit when device disconnects\n" \ |
| 529 | " -h, --help prints usage information\n" \ | 531 | " -h, --help prints usage information\n" \ |
| 530 | " -d, --debug enable communication debugging\n" \ | 532 | " -d, --debug enable communication debugging\n" \ |
| 533 | " -v, --version prints version information\n" \ | ||
| 531 | " --no-colors disable colored output\n" \ | 534 | " --no-colors disable colored output\n" \ |
| 532 | "\n" \ | 535 | "\n" \ |
| 533 | "FILTER OPTIONS:\n" \ | 536 | "FILTER OPTIONS:\n" \ |
| @@ -581,6 +584,7 @@ int main(int argc, char *argv[]) | |||
| 581 | { "no-kernel", no_argument, NULL, 'K' }, | 584 | { "no-kernel", no_argument, NULL, 'K' }, |
| 582 | { "quiet-list", no_argument, NULL, 1 }, | 585 | { "quiet-list", no_argument, NULL, 1 }, |
| 583 | { "no-colors", no_argument, NULL, 2 }, | 586 | { "no-colors", no_argument, NULL, 2 }, |
| 587 | { "version", no_argument, NULL, 'v' }, | ||
| 584 | { NULL, 0, NULL, 0} | 588 | { NULL, 0, NULL, 0} |
| 585 | }; | 589 | }; |
| 586 | 590 | ||
| @@ -591,7 +595,7 @@ int main(int argc, char *argv[]) | |||
| 591 | signal(SIGPIPE, SIG_IGN); | 595 | signal(SIGPIPE, SIG_IGN); |
| 592 | #endif | 596 | #endif |
| 593 | 597 | ||
| 594 | while ((c = getopt_long(argc, argv, "dhu:nxt:T:m:e:p:qkK", longopts, NULL)) != -1) { | 598 | while ((c = getopt_long(argc, argv, "dhu:nxt:T:m:e:p:qkKv", longopts, NULL)) != -1) { |
| 595 | switch (c) { | 599 | switch (c) { |
| 596 | case 'd': | 600 | case 'd': |
| 597 | idevice_set_debug_level(1); | 601 | idevice_set_debug_level(1); |
| @@ -693,6 +697,9 @@ int main(int argc, char *argv[]) | |||
| 693 | case 2: | 697 | case 2: |
| 694 | no_colors = 1; | 698 | no_colors = 1; |
| 695 | break; | 699 | break; |
| 700 | case 'v': | ||
| 701 | printf("%s %s\n", TOOL_NAME, PACKAGE_VERSION); | ||
| 702 | return 0; | ||
| 696 | default: | 703 | default: |
| 697 | print_usage(argc, argv, 1); | 704 | print_usage(argc, argv, 1); |
| 698 | return 2; | 705 | return 2; |
