2 #include "command-line-arguments.h"
5 int main(int argc, char **argv){
14 char *string_val=NULL;
16 notmuch_opt_desc_t options[] = {
17 { NOTMUCH_OPT_KEYWORD, &kw_val, "keyword", 'k',
18 (notmuch_keyword_t []){ { "one", 1 },
21 { NOTMUCH_OPT_KEYWORD_FLAGS, &fl_val, "flag", 'f',
22 (notmuch_keyword_t []){ { "one", 1 << 0},
26 { NOTMUCH_OPT_INT, &int_val, "int", 'i', 0},
27 { NOTMUCH_OPT_STRING, &string_val, "string", 's', 0},
28 { NOTMUCH_OPT_POSITION, &pos_arg1, 0,0, 0},
29 { NOTMUCH_OPT_POSITION, &pos_arg2, 0,0, 0},
32 opt_index = parse_arguments(argc, argv, options, 1);
38 printf("keyword %d\n", kw_val);
41 printf("flags %d\n", fl_val);
44 printf("int %d\n", int_val);
47 printf("string %s\n", string_val);
50 printf("positional arg 1 %s\n", pos_arg1);
53 printf("positional arg 2 %s\n", pos_arg2);
56 for ( ; opt_index < argc ; opt_index ++) {
57 printf("non parsed arg %d = %s\n", opt_index, argv[opt_index]);