summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2020-05-28 23:11:24 +0200
committerGravatar Nikias Bassen2020-05-28 23:11:24 +0200
commit45ba75a9a48f61b65e4487fa706dc764a85198b9 (patch)
treeff382b3c197ae36b9d5d4bf5c24497aabef430e7 /tools
parent4331c3c06bc3b99c271996523866ae5184a87521 (diff)
downloadlibimobiledevice-45ba75a9a48f61b65e4487fa706dc764a85198b9.tar.gz
libimobiledevice-45ba75a9a48f61b65e4487fa706dc764a85198b9.tar.bz2
idevicesyslog: Add command line switch --no-colors to disable colored output
Diffstat (limited to 'tools')
-rw-r--r--tools/idevicesyslog.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/idevicesyslog.c b/tools/idevicesyslog.c
index 5d5a639..bd692cd 100644
--- a/tools/idevicesyslog.c
+++ b/tools/idevicesyslog.c
@@ -526,6 +526,7 @@ static void print_usage(int argc, char **argv, int is_error)
526 " -x, --exit exit when device disconnects\n" \ 526 " -x, --exit exit when device disconnects\n" \
527 " -h, --help prints usage information\n" \ 527 " -h, --help prints usage information\n" \
528 " -d, --debug enable communication debugging\n" \ 528 " -d, --debug enable communication debugging\n" \
529 " --no-colors disable colored output\n" \
529 "\n" \ 530 "\n" \
530 "FILTER OPTIONS:\n" \ 531 "FILTER OPTIONS:\n" \
531 " -m, --match STRING only print messages that contain STRING\n" \ 532 " -m, --match STRING only print messages that contain STRING\n" \
@@ -553,6 +554,7 @@ int main(int argc, char *argv[])
553 COLOR_RESET = csbi.wAttributes; 554 COLOR_RESET = csbi.wAttributes;
554 } 555 }
555#endif 556#endif
557 int no_colors = 0;
556 int include_filter = 0; 558 int include_filter = 0;
557 int exclude_filter = 0; 559 int exclude_filter = 0;
558 int include_kernel = 0; 560 int include_kernel = 0;
@@ -573,6 +575,7 @@ int main(int argc, char *argv[])
573 { "kernel", no_argument, NULL, 'k' }, 575 { "kernel", no_argument, NULL, 'k' },
574 { "no-kernel", no_argument, NULL, 'K' }, 576 { "no-kernel", no_argument, NULL, 'K' },
575 { "quiet-list", no_argument, NULL, 1 }, 577 { "quiet-list", no_argument, NULL, 1 },
578 { "no-colors", no_argument, NULL, 2 },
576 { NULL, 0, NULL, 0} 579 { NULL, 0, NULL, 0}
577 }; 580 };
578 581
@@ -682,6 +685,9 @@ int main(int argc, char *argv[])
682 printf("%s\n", QUIET_FILTER); 685 printf("%s\n", QUIET_FILTER);
683 return 0; 686 return 0;
684 } 687 }
688 case 2:
689 no_colors = 1;
690 break;
685 default: 691 default:
686 print_usage(argc, argv, 1); 692 print_usage(argc, argv, 1);
687 return 2; 693 return 2;
@@ -733,7 +739,7 @@ int main(int argc, char *argv[])
733 argc -= optind; 739 argc -= optind;
734 argv += optind; 740 argv += optind;
735 741
736 if (isatty(1)) { 742 if (!no_colors && isatty(1)) {
737 use_colors = 1; 743 use_colors = 1;
738 } 744 }
739 745