1 #ifndef LIST_OBJECTS_FILTER_OPTIONS_H
2 #define LIST_OBJECTS_FILTER_OPTIONS_H
4 #include "parse-options.h"
7 * The list of defined filters for list-objects.
9 enum list_objects_filter_choice {
15 LOFC__COUNT /* must be last */
18 struct list_objects_filter_options {
20 * 'filter_spec' is the raw argument value given on the command line
21 * or protocol request. (The part after the "--keyword=".) For
22 * commands that launch filtering sub-processes, this value should be
23 * passed to them as received by the current process.
28 * 'choice' is determined by parsing the filter-spec. This indicates
29 * the filtering algorithm to use.
31 enum list_objects_filter_choice choice;
34 * Parsed values (fields) from within the filter-spec. These are
35 * choice-specific; not all values will be defined for any given
38 struct object_id *sparse_oid_value;
39 char *sparse_path_value;
40 unsigned long blob_limit_value;
43 /* Normalized command line arguments */
44 #define CL_ARG__FILTER "filter"
46 int parse_list_objects_filter(
47 struct list_objects_filter_options *filter_options,
50 int opt_parse_list_objects_filter(const struct option *opt,
51 const char *arg, int unset);
53 #define OPT_PARSE_LIST_OBJECTS_FILTER(fo) \
54 { OPTION_CALLBACK, 0, CL_ARG__FILTER, fo, N_("args"), \
55 N_("object filtering"), 0, \
56 opt_parse_list_objects_filter }
58 void list_objects_filter_release(
59 struct list_objects_filter_options *filter_options);
61 #endif /* LIST_OBJECTS_FILTER_OPTIONS_H */