summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-03-24 08:20:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-24 13:21:22 (GMT)
commit85f8e889ea3b1eeb0d183c6db8c4a407a8133350 (patch)
tree351e69cc5cd2c4c508843447c01e0f3b6d5c0b95 /diff.c
parenta41cfb3203843fe47d902622dcf33db2209a0d1c (diff)
downloadgit-85f8e889ea3b1eeb0d183c6db8c4a407a8133350.zip
git-85f8e889ea3b1eeb0d183c6db8c4a407a8133350.tar.gz
git-85f8e889ea3b1eeb0d183c6db8c4a407a8133350.tar.bz2
diff-parseopt: convert --pickaxe-all|--pickaxe-regex
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/diff.c b/diff.c
index 8f01fbc..699f860 100644
--- a/diff.c
+++ b/diff.c
@@ -5391,6 +5391,12 @@ static void prep_parse_options(struct diff_options *options)
OPT_CALLBACK_F('G', NULL, options, N_("<regex>"),
N_("look for differences that change the number of occurrences of the specified regex"),
0, diff_opt_pickaxe_regex),
+ OPT_BIT_F(0, "pickaxe-all", &options->pickaxe_opts,
+ N_("show all changes in the changeset with -S or -G"),
+ DIFF_PICKAXE_ALL, PARSE_OPT_NONEG),
+ OPT_BIT_F(0, "pickaxe-regex", &options->pickaxe_opts,
+ N_("treat <string> in -S as extended POSIX regular expression"),
+ DIFF_PICKAXE_REGEX, PARSE_OPT_NONEG),
{ OPTION_CALLBACK, 0, "output", options, N_("<file>"),
N_("Output to a specific file"),
PARSE_OPT_NONEG, NULL, 0, diff_opt_output },
@@ -5443,10 +5449,6 @@ int diff_opt_parse(struct diff_options *options,
}
/* misc options */
- else if (!strcmp(arg, "--pickaxe-all"))
- options->pickaxe_opts |= DIFF_PICKAXE_ALL;
- else if (!strcmp(arg, "--pickaxe-regex"))
- options->pickaxe_opts |= DIFF_PICKAXE_REGEX;
else if ((argcount = short_opt('O', av, &optarg))) {
options->orderfile = prefix_filename(prefix, optarg);
return argcount;