Skip to content

Commit aae8558

Browse files
rscharfegitster
authored andcommitted
grep: reject --no-or
Since 3e230fa (grep: use parseopt, 2009-05-07) git grep has been accepting the option --no-or. It does the same as --or: nothing. That's confusing and unintended. Forbid negating --or. Signed-off-by: René Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0d1bd1d commit aae8558

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/grep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
976976
OPT_CALLBACK_F(0, "and", &opt, NULL,
977977
N_("combine patterns specified with -e"),
978978
PARSE_OPT_NOARG | PARSE_OPT_NONEG, and_callback),
979-
OPT_BOOL(0, "or", &dummy, ""),
979+
OPT_BOOL_F(0, "or", &dummy, "", PARSE_OPT_NONEG),
980980
OPT_CALLBACK_F(0, "not", &opt, NULL, "",
981981
PARSE_OPT_NOARG | PARSE_OPT_NONEG, not_callback),
982982
OPT_CALLBACK_F('(', NULL, &opt, NULL, "",

0 commit comments

Comments
 (0)