grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep branch, master, updated. v3.3-20-g6193ba1


From: Paul Eggert
Subject: grep branch, master, updated. v3.3-20-g6193ba1
Date: Tue, 5 Nov 2019 18:33:25 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  6193ba1cb5669a3e06e0320254b1c181297d41eb (commit)
      from  50312b72f570609abb85fc0add7554be0ac8721e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=6193ba1cb5669a3e06e0320254b1c181297d41eb


commit 6193ba1cb5669a3e06e0320254b1c181297d41eb
Author: Paul Eggert <address@hidden>
Date:   Tue Nov 5 15:32:58 2019 -0800

    grep: new --no-ignore-case option
    
    Suggested by Karl Berry and mostly implemented by Arnold Robbins
    (Bug#37907).
    * NEWS:
    * doc/grep.in.1:
    * doc/grep.texi (Matching Control):
    * src/grep.c (usage):
    Document the new option.
    * src/grep.c (NO_IGNORE_CASE_OPTION): New constant.
    (long_options, main): Support new option.

diff --git a/NEWS b/NEWS
index 9ce65b3..c31c600 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,11 @@ GNU grep NEWS                                    -*- outline 
-*-
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
+** New features
+
+  The new --no-ignore-case option causes grep to observe case
+  distinctions, overriding any previous -i (--ignore-case) option.
+
 ** Bug fixes
 
   The exit status of 'grep -L' is no longer incorrect when standard
diff --git a/doc/grep.in.1 b/doc/grep.in.1
index a2cbf5c..219f37f 100644
--- a/doc/grep.in.1
+++ b/doc/grep.in.1
@@ -254,6 +254,13 @@ Ignore case distinctions in patterns and input data,
 so that characters that differ only in case
 match each other.
 .TP
+.B \-\^\-no\-ignore\-case
+Do not ignore case distinctions in patterns and input data.
+This is the default.
+This option is useful for passing to shell scripts that already use
+.BR \-i ,
+to cancel its effects because the two options override each other.
+.TP
 .BR \-v ", " \-\^\-invert\-match
 Invert the sense of matching, to select non-matching lines.
 .TP
@@ -683,7 +690,7 @@ Follow all symbolic links, unlike
 .BR \-r .
 .SS "Other Options"
 .TP
-.BR \-\^\-line\-buffered
+.B \-\^\-line\-buffered
 Use line buffering on output.
 This can cause a performance penalty.
 .TP
diff --git a/doc/grep.texi b/doc/grep.texi
index f5edc72..01ad5f7 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -215,6 +215,13 @@ SHARP S) even though lowercasing the latter yields the 
former.
 @option{-y} is an obsolete synonym that is provided for compatibility.
 (@option{-i} is specified by POSIX.)
 
+@item --no-ignore-case
+@opindex --no-ignore-case
+Do not ignore case distinctions in patterns and input data.  This is
+the default.  This option is useful for passing to shell scripts that
+already use @option{-i}, in order to cancel its effects because the
+two options override each other.
+
 @item -v
 @itemx --invert-match
 @opindex -v
diff --git a/src/grep.c b/src/grep.c
index 7f3ada1..edf90ab 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -424,7 +424,8 @@ enum
   GROUP_SEPARATOR_OPTION,
   INCLUDE_OPTION,
   LINE_BUFFERED_OPTION,
-  LABEL_OPTION
+  LABEL_OPTION,
+  NO_IGNORE_CASE_OPTION
 };
 
 /* Long options equivalences. */
@@ -455,6 +456,7 @@ static struct option const long_options[] =
   {"help", no_argument, &show_help, 1},
   {"include", required_argument, NULL, INCLUDE_OPTION},
   {"ignore-case", no_argument, NULL, 'i'},
+  {"no-ignore-case", no_argument, NULL, NO_IGNORE_CASE_OPTION},
   {"initial-tab", no_argument, NULL, 'T'},
   {"label", required_argument, NULL, LABEL_OPTION},
   {"line-buffered", no_argument, NULL, LINE_BUFFERED_OPTION},
@@ -1927,6 +1929,7 @@ Pattern selection and interpretation:\n"), getprogname 
());
   -e, --regexp=PATTERNS     use PATTERNS for matching\n\
   -f, --file=FILE           take PATTERNS from FILE\n\
   -i, --ignore-case         ignore case distinctions in patterns and data\n\
+      --no-ignore-case      do not ignore case distinctions (default)\n\
   -w, --word-regexp         match only whole words\n\
   -x, --line-regexp         match only whole lines\n\
   -z, --null-data           a data line ends in 0 byte, not newline\n"));
@@ -2617,6 +2620,10 @@ main (int argc, char **argv)
         match_icase = true;
         break;
 
+      case NO_IGNORE_CASE_OPTION:
+        match_icase = false;
+        break;
+
       case 'L':
         /* Like -l, except list files that don't contain matches.
            Inspired by the same option in Hume's gre. */

-----------------------------------------------------------------------

Summary of changes:
 NEWS          | 5 +++++
 doc/grep.in.1 | 9 ++++++++-
 doc/grep.texi | 7 +++++++
 src/grep.c    | 9 ++++++++-
 4 files changed, 28 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

[Prev in Thread] Current Thread [Next in Thread]