grep: make errors other than "not found" result in exit code 2. Closes 8796
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
b9b7aa1910
commit
73dfdda92e
@ -681,11 +681,15 @@ int grep_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
FILE *file;
|
FILE *file;
|
||||||
int matched;
|
int matched;
|
||||||
llist_t *fopt = NULL;
|
llist_t *fopt = NULL;
|
||||||
|
#if ENABLE_FEATURE_GREP_CONTEXT
|
||||||
|
int Copt, opts;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* For grep, exitcode of 1 is "not found". Other errors are 2: */
|
||||||
|
xfunc_error_retval = 2;
|
||||||
|
|
||||||
/* do normal option parsing */
|
/* do normal option parsing */
|
||||||
#if ENABLE_FEATURE_GREP_CONTEXT
|
#if ENABLE_FEATURE_GREP_CONTEXT
|
||||||
int Copt, opts;
|
|
||||||
|
|
||||||
/* -H unsets -h; -C unsets -A,-B; -e,-f are lists;
|
/* -H unsets -h; -C unsets -A,-B; -e,-f are lists;
|
||||||
* -m,-A,-B,-C have numeric param */
|
* -m,-A,-B,-C have numeric param */
|
||||||
opt_complementary = "H-h:C-AB:e::f::m+:A+:B+:C+";
|
opt_complementary = "H-h:C-AB:e::f::m+:A+:B+:C+";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user