list-objects-filter: remove CL_ARG__FILTER
We have established the command-line interface for the --[no-]filter options for a while now, so we do not need a helper to make this editable in the future. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Derrick Stolee committed
Mar 22, 2022 at 17:28 UTC
cc910442560e606546a328375c1394a982dfe8a6
3 files changed
+5
-8
builtin/fetch-pack.c
+2
-2
@@ -153,11 +153,11 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
153
args.from_promisor = 1;
154
continue;
155
}
156
- if (skip_prefix(arg, ("--" CL_ARG__FILTER "="), &arg)) {
156
+ if (skip_prefix(arg, ("--filter="), &arg)) {
157
parse_list_objects_filter(&args.filter_options, arg);
158
continue;
159
}
160
- if (!strcmp(arg, ("--no-" CL_ARG__FILTER))) {
160
+ if (!strcmp(arg, ("--no-filter"))) {
161
list_objects_filter_set_no_filter(&args.filter_options);
162
continue;
163
}
list-objects-filter-options.h
+1
-4
@@ -69,9 +69,6 @@ struct list_objects_filter_options {
69
*/
70
};
71
72
-/* Normalized command line arguments */
73
-#define CL_ARG__FILTER "filter"
74
-
72
/*
73
* Parse value of the argument to the "filter" keyword.
74
* On the command line this looks like:
@@ -111,7 +108,7 @@ int opt_parse_list_objects_filter(const struct option *opt,
108
const char *arg, int unset);
109
110
#define OPT_PARSE_LIST_OBJECTS_FILTER(fo) \
114
- OPT_CALLBACK(0, CL_ARG__FILTER, fo, N_("args"), \
111
+ OPT_CALLBACK(0, "filter", fo, N_("args"), \
112
N_("object filtering"), \
113
opt_parse_list_objects_filter)
114
revision.c
+2
-2
@@ -2691,9 +2691,9 @@ static int handle_revision_pseudo_opt(struct rev_info *revs,
2691
revs->no_walk = 0;
2692
} else if (!strcmp(arg, "--single-worktree")) {
2693
revs->single_worktree = 1;
2694
- } else if (skip_prefix(arg, ("--" CL_ARG__FILTER "="), &arg)) {
2694
+ } else if (skip_prefix(arg, ("--filter="), &arg)) {
2695
parse_list_objects_filter(&revs->filter, arg);
2696
- } else if (!strcmp(arg, ("--no-" CL_ARG__FILTER))) {
2696
+ } else if (!strcmp(arg, ("--no-filter"))) {
2697
list_objects_filter_set_no_filter(&revs->filter);
2698
} else {
2699
return 0;