diff options
| author | 2022-04-30 13:31:20 +0200 | |
|---|---|---|
| committer | 2022-04-30 13:31:20 +0200 | |
| commit | 6cb13f9e6d3939930aecf91d8e23d1896a3b92e5 (patch) | |
| tree | 371e4676ac914d9eef6bb4cfc0b5b6dc6f27da4f /tools/idevicesyslog.c | |
| parent | 3b5cad28fabb236e05b8fff82fab5098127aa2bb (diff) | |
| download | libimobiledevice-6cb13f9e6d3939930aecf91d8e23d1896a3b92e5.tar.gz libimobiledevice-6cb13f9e6d3939930aecf91d8e23d1896a3b92e5.tar.bz2 | |
tools: Use getopt for option parsing in all tools
Diffstat (limited to 'tools/idevicesyslog.c')
| -rw-r--r-- | tools/idevicesyslog.c | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/tools/idevicesyslog.c b/tools/idevicesyslog.c index 44dd5ba..2a72d72 100644 --- a/tools/idevicesyslog.c +++ b/tools/idevicesyslog.c | |||
| @@ -466,37 +466,36 @@ static void clean_exit(int sig) | |||
| 466 | 466 | ||
| 467 | static void print_usage(int argc, char **argv, int is_error) | 467 | static void print_usage(int argc, char **argv, int is_error) |
| 468 | { | 468 | { |
| 469 | char *name = NULL; | 469 | char *name = strrchr(argv[0], '/'); |
| 470 | name = strrchr(argv[0], '/'); | ||
| 471 | fprintf(is_error ? stderr : stdout, "Usage: %s [OPTIONS]\n", (name ? name + 1: argv[0])); | 470 | fprintf(is_error ? stderr : stdout, "Usage: %s [OPTIONS]\n", (name ? name + 1: argv[0])); |
| 472 | fprintf(is_error ? stderr : stdout, | 471 | fprintf(is_error ? stderr : stdout, |
| 473 | "\n" \ | 472 | "\n" |
| 474 | "Relay syslog of a connected device.\n" \ | 473 | "Relay syslog of a connected device.\n" |
| 475 | "\n" \ | 474 | "\n" |
| 476 | "OPTIONS:\n" \ | 475 | "OPTIONS:\n" |
| 477 | " -u, --udid UDID target specific device by UDID\n" \ | 476 | " -u, --udid UDID target specific device by UDID\n" |
| 478 | " -n, --network connect to network device\n" \ | 477 | " -n, --network connect to network device\n" |
| 479 | " -x, --exit exit when device disconnects\n" \ | 478 | " -x, --exit exit when device disconnects\n" |
| 480 | " -h, --help prints usage information\n" \ | 479 | " -h, --help prints usage information\n" |
| 481 | " -d, --debug enable communication debugging\n" \ | 480 | " -d, --debug enable communication debugging\n" |
| 482 | " -v, --version prints version information\n" \ | 481 | " -v, --version prints version information\n" |
| 483 | " --no-colors disable colored output\n" \ | 482 | " --no-colors disable colored output\n" |
| 484 | "\n" \ | 483 | "\n" |
| 485 | "FILTER OPTIONS:\n" \ | 484 | "FILTER OPTIONS:\n" |
| 486 | " -m, --match STRING only print messages that contain STRING\n" \ | 485 | " -m, --match STRING only print messages that contain STRING\n" |
| 487 | " -t, --trigger STRING start logging when matching STRING\n" \ | 486 | " -t, --trigger STRING start logging when matching STRING\n" |
| 488 | " -T, --untrigger STRING stop logging when matching STRING\n" \ | 487 | " -T, --untrigger STRING stop logging when matching STRING\n" |
| 489 | " -p, --process PROCESS only print messages from matching process(es)\n" \ | 488 | " -p, --process PROCESS only print messages from matching process(es)\n" |
| 490 | " -e, --exclude PROCESS print all messages except matching process(es)\n" \ | 489 | " -e, --exclude PROCESS print all messages except matching process(es)\n" |
| 491 | " PROCESS is a process name or multiple process names\n" \ | 490 | " PROCESS is a process name or multiple process names\n" |
| 492 | " separated by \"|\".\n" \ | 491 | " separated by \"|\".\n" |
| 493 | " -q, --quiet set a filter to exclude common noisy processes\n" \ | 492 | " -q, --quiet set a filter to exclude common noisy processes\n" |
| 494 | " --quiet-list prints the list of processes for --quiet and exits\n" \ | 493 | " --quiet-list prints the list of processes for --quiet and exits\n" |
| 495 | " -k, --kernel only print kernel messages\n" \ | 494 | " -k, --kernel only print kernel messages\n" |
| 496 | " -K, --no-kernel suppress kernel messages\n" \ | 495 | " -K, --no-kernel suppress kernel messages\n" |
| 497 | "\n" \ | 496 | "\n" |
| 498 | "For filter examples consult idevicesyslog(1) man page.\n" \ | 497 | "For filter examples consult idevicesyslog(1) man page.\n" |
| 499 | "\n" \ | 498 | "\n" |
| 500 | "Homepage: <" PACKAGE_URL ">\n" | 499 | "Homepage: <" PACKAGE_URL ">\n" |
| 501 | "Bug Reports: <" PACKAGE_BUGREPORT ">\n" | 500 | "Bug Reports: <" PACKAGE_BUGREPORT ">\n" |
| 502 | ); | 501 | ); |
