Skip to content

Commit

Permalink
Merge branch 'rs/grep-parseopt-simplify' into next
Browse files Browse the repository at this point in the history
Simplify use of parse-options API a bit.

* rs/grep-parseopt-simplify:
  grep: use OPT_INTEGER_F for --max-depth
  • Loading branch information
gitster committed Sep 6, 2023
2 parents c5154b7 + 2a63c79 commit 249b69c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions builtin/grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -924,9 +924,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
N_("process binary files with textconv filters")),
OPT_SET_INT('r', "recursive", &opt.max_depth,
N_("search in subdirectories (default)"), -1),
{ OPTION_INTEGER, 0, "max-depth", &opt.max_depth, N_("depth"),
N_("descend at most <depth> levels"), PARSE_OPT_NONEG,
NULL, 1 },
OPT_INTEGER_F(0, "max-depth", &opt.max_depth,
N_("descend at most <n> levels"), PARSE_OPT_NONEG),
OPT_GROUP(""),
OPT_SET_INT('E', "extended-regexp", &opt.pattern_type_option,
N_("use extended POSIX regular expressions"),
Expand Down

0 comments on commit 249b69c

Please sign in to comment.