Skip to content

Commit 85f8e88

Browse files
pcloudsgitster
authored andcommitted
diff-parseopt: convert --pickaxe-all|--pickaxe-regex
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a41cfb3 commit 85f8e88

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

diff.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5391,6 +5391,12 @@ static void prep_parse_options(struct diff_options *options)
53915391
OPT_CALLBACK_F('G', NULL, options, N_("<regex>"),
53925392
N_("look for differences that change the number of occurrences of the specified regex"),
53935393
0, diff_opt_pickaxe_regex),
5394+
OPT_BIT_F(0, "pickaxe-all", &options->pickaxe_opts,
5395+
N_("show all changes in the changeset with -S or -G"),
5396+
DIFF_PICKAXE_ALL, PARSE_OPT_NONEG),
5397+
OPT_BIT_F(0, "pickaxe-regex", &options->pickaxe_opts,
5398+
N_("treat <string> in -S as extended POSIX regular expression"),
5399+
DIFF_PICKAXE_REGEX, PARSE_OPT_NONEG),
53945400
{ OPTION_CALLBACK, 0, "output", options, N_("<file>"),
53955401
N_("Output to a specific file"),
53965402
PARSE_OPT_NONEG, NULL, 0, diff_opt_output },
@@ -5443,10 +5449,6 @@ int diff_opt_parse(struct diff_options *options,
54435449
}
54445450

54455451
/* misc options */
5446-
else if (!strcmp(arg, "--pickaxe-all"))
5447-
options->pickaxe_opts |= DIFF_PICKAXE_ALL;
5448-
else if (!strcmp(arg, "--pickaxe-regex"))
5449-
options->pickaxe_opts |= DIFF_PICKAXE_REGEX;
54505452
else if ((argcount = short_opt('O', av, &optarg))) {
54515453
options->orderfile = prefix_filename(prefix, optarg);
54525454
return argcount;

0 commit comments

Comments
 (0)