Skip to content

Commit 19d5a0b

Browse files
committed
Merge branch 'rs/grep-parseopt-simplify'
Simplify use of parse-options API a bit. * rs/grep-parseopt-simplify: grep: use OPT_INTEGER_F for --max-depth
2 parents d6c5197 + 2a63c79 commit 19d5a0b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

builtin/grep.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -924,9 +924,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
924924
N_("process binary files with textconv filters")),
925925
OPT_SET_INT('r', "recursive", &opt.max_depth,
926926
N_("search in subdirectories (default)"), -1),
927-
{ OPTION_INTEGER, 0, "max-depth", &opt.max_depth, N_("depth"),
928-
N_("descend at most <depth> levels"), PARSE_OPT_NONEG,
929-
NULL, 1 },
927+
OPT_INTEGER_F(0, "max-depth", &opt.max_depth,
928+
N_("descend at most <n> levels"), PARSE_OPT_NONEG),
930929
OPT_GROUP(""),
931930
OPT_SET_INT('E', "extended-regexp", &opt.pattern_type_option,
932931
N_("use extended POSIX regular expressions"),

0 commit comments

Comments
 (0)