aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-07-13 20:40:40 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2018-07-13 20:40:40 +0200
commit8717b14f376e38998512c022b3d2b1af6e877e5e (patch)
treeb93124db65a5cdb292c95d113c57ff5a294e05b7
parent79fb6ac7a5acc4178b66314c573aeada1d387ed9 (diff)
downloadbusybox-w32-8717b14f376e38998512c022b3d2b1af6e877e5e.tar.gz
busybox-w32-8717b14f376e38998512c022b3d2b1af6e877e5e.tar.bz2
busybox-w32-8717b14f376e38998512c022b3d2b1af6e877e5e.zip
grep: accept and ignore --color[=anything]
function old new delta grep_main 827 834 +7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--findutils/grep.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index 88de0d4ef..3e8ea9239 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -704,10 +704,15 @@ int grep_main(int argc UNUSED_PARAM, char **argv)
704 /* do normal option parsing */ 704 /* do normal option parsing */
705#if ENABLE_FEATURE_GREP_CONTEXT 705#if ENABLE_FEATURE_GREP_CONTEXT
706 /* -H unsets -h; -C unsets -A,-B */ 706 /* -H unsets -h; -C unsets -A,-B */
707 opts = getopt32(argv, 707 opts = getopt32long(argv, "^"
708 "^" OPTSTR_GREP "\0" "H-h:C-AB", 708 OPTSTR_GREP
709 "\0"
710 "H-h:C-AB",
711 "color\0" Optional_argument "\xff",
709 &pattern_head, &fopt, &max_matches, 712 &pattern_head, &fopt, &max_matches,
710 &lines_after, &lines_before, &Copt); 713 &lines_after, &lines_before, &Copt
714 , NULL
715 );
711 716
712 if (opts & OPT_C) { 717 if (opts & OPT_C) {
713 /* -C unsets prev -A and -B, but following -A or -B 718 /* -C unsets prev -A and -B, but following -A or -B