X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=command-line-arguments.h;h=f722f97dde6e57c691437914b91cf42128384fa9;hp=dfc808bdab7838c81746f7671ba2fa8b3b904ce9;hb=f2e6f76a046492650713c1c3f1f1a19f49de59ea;hpb=bc99087ff95d0cdada827f3b838d05e0c9448b63 diff --git a/command-line-arguments.h b/command-line-arguments.h index dfc808bd..f722f97d 100644 --- a/command-line-arguments.h +++ b/command-line-arguments.h @@ -1,6 +1,8 @@ #ifndef NOTMUCH_OPTS_H #define NOTMUCH_OPTS_H +#include + #include "notmuch.h" /* @@ -17,18 +19,25 @@ typedef struct notmuch_keyword { typedef struct notmuch_opt_desc { /* One and only one of opt_* must be set. */ const struct notmuch_opt_desc *opt_inherit; - notmuch_bool_t *opt_bool; + bool *opt_bool; int *opt_int; int *opt_keyword; int *opt_flags; const char **opt_string; const char **opt_position; + /* for opt_keyword only: if no matching arguments were found, and + * keyword_no_arg_value is set, then use keyword_no_arg_value instead. */ + const char *keyword_no_arg_value; + /* Must be set except for opt_inherit and opt_position. */ const char *name; - /* Optional, if non-NULL, set to TRUE if the option is present. */ - notmuch_bool_t *present; + /* Optional, if non-NULL, set to true if the option is present. */ + bool *present; + + /* Optional, allow empty strings for opt_string. */ + bool allow_empty; /* Must be set for opt_keyword and opt_flags. */ const struct notmuch_keyword *keywords; @@ -64,7 +73,7 @@ parse_arguments (int argc, char **argv, const notmuch_opt_desc_t *options, int o int parse_option (int argc, char **argv, const notmuch_opt_desc_t* options, int opt_index); -notmuch_bool_t +bool parse_position_arg (const char *arg, int position_arg_index, const notmuch_opt_desc_t* options);