diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-11-02 10:53:23 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-11-02 10:53:24 +0300 |
commit | 2fdfd7594f2ecfe50314ddd0caabc0a84197357e (patch) | |
tree | f9a04b09f5285bf3bc8ee20ecba8d2f8f4dd4083 | |
parent | 18e0648b9b9cc61f4b4bff12c97bf9ef2737b5d5 (diff) | |
parent | 2a63c79dae72b25420bc71116bef7436fd846758 (diff) |
Merge branch 'rs/grep-parseopt-simplify' into maint-2.42
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.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/builtin/grep.c b/builtin/grep.c index 2a261074f1..b71222330a 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"), |