aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-09-14 11:16:58 -0700
committerJunio C Hamano <gitster@pobox.com>2023-09-14 11:16:58 -0700
commit19d5a0b2c130b167c1f8c5bfab9ef2d8c49f78d0 (patch)
tree6cd5c6f1a9d6ea11da233c1907b5447fc48f2a19
parentd6c51973e4a0e889d1a426da08f52b9203fa1df2 (diff)
parent2a63c79dae72b25420bc71116bef7436fd846758 (diff)
downloadgit-19d5a0b2c130b167c1f8c5bfab9ef2d8c49f78d0.tar.xz
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
-rw-r--r--builtin/grep.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 50e712a184..f5f5f6dbe1 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -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"),