7 * Describe one of the possibilities for a keyword option
8 * 'value' will be copied to the output variable
11 typedef struct notmuch_keyword {
16 /* Describe one option. */
17 typedef struct notmuch_opt_desc {
18 /* One and only one of opt_* must be set. */
19 const struct notmuch_opt_desc *opt_inherit;
20 notmuch_bool_t *opt_bool;
24 const char **opt_string;
25 const char **opt_position;
27 /* Must be set except for opt_inherit and opt_position. */
30 /* Must be set for opt_keyword and opt_flags. */
31 const struct notmuch_keyword *keywords;
36 This is the main entry point for command line argument parsing.
38 Parse command line arguments according to structure options,
39 starting at position opt_index.
41 All output of parsed values is via pointers in options.
43 Parsing stops at -- (consumed) or at the (k+1)st argument
44 not starting with -- (a "positional argument") if options contains
45 k positional argument descriptors.
47 Returns the index of first non-parsed argument, or -1 in case of error.
51 parse_arguments (int argc, char **argv, const notmuch_opt_desc_t *options, int opt_index);
54 * If the argument parsing loop provided by parse_arguments is not
55 * flexible enough, then the user might be interested in the following
56 * routines, but note that the API to parse_option might have to
57 * change. See command-line-arguments.c for descriptions of these
62 parse_option (int argc, char **argv, const notmuch_opt_desc_t* options, int opt_index);
65 parse_position_arg (const char *arg,
66 int position_arg_index,
67 const notmuch_opt_desc_t* options);