grep: use OPT_INTEGER_F for --max-depth
commit2a63c79dae72b25420bc71116bef7436fd846758
authorRené Scharfe <l.s.r@web.de>
Sat, 2 Sep 2023 18:54:54 +0000 (2 20:54 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 Sep 2023 21:59:26 +0000 (5 14:59 -0700)
treedc1c9e6843f814777ba2c249b4479e8da29b1fec
parent43c8a30d150ecede9709c1f2527c8fba92c65f40
grep: use OPT_INTEGER_F for --max-depth

a91f453f64 (grep: Add --max-depth option., 2009-07-22) added the option
--max-depth, defining it using a positional struct option initializer of
type OPTION_INTEGER.  It also sets defval to 1 for some reason, but that
value would only be used if the flag PARSE_OPT_OPTARG was given.

Use the macro OPT_INTEGER_F instead to standardize the definition and
specify only the necessary values.  This also normalizes argh to N_("n")
as a side-effect, which is OK.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/grep.c