X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2Farg-test.c;h=736686ded2c07287f1daf237a5b6c22f71e5bb82;hp=adc56e30e7d97e449a328ed8ff7642b429084b7b;hb=14c60cf168ac3b0f277188c16e6012b7ebdadde7;hpb=5800a44bd5b77390d2243426f0c82de4d0495a1c diff --git a/test/arg-test.c b/test/arg-test.c index adc56e30..736686de 100644 --- a/test/arg-test.c +++ b/test/arg-test.c @@ -7,6 +7,7 @@ int main(int argc, char **argv){ int opt_index=1; int kw_val=0; + int fl_val=0; int int_val=0; char *pos_arg1=NULL; char *pos_arg2=NULL; @@ -17,6 +18,11 @@ int main(int argc, char **argv){ (notmuch_keyword_t []){ { "one", 1 }, { "two", 2 }, { 0, 0 } } }, + { NOTMUCH_OPT_KEYWORD_FLAGS, &fl_val, "flag", 'f', + (notmuch_keyword_t []){ { "one", 1 << 0}, + { "two", 1 << 1 }, + { "three", 1 << 2 }, + { 0, 0 } } }, { NOTMUCH_OPT_INT, &int_val, "int", 'i', 0}, { NOTMUCH_OPT_STRING, &string_val, "string", 's', 0}, { NOTMUCH_OPT_POSITION, &pos_arg1, 0,0, 0}, @@ -31,6 +37,9 @@ int main(int argc, char **argv){ if (kw_val) printf("keyword %d\n", kw_val); + if (fl_val) + printf("flags %d\n", fl_val); + if (int_val) printf("int %d\n", int_val); @@ -41,7 +50,7 @@ int main(int argc, char **argv){ printf("positional arg 1 %s\n", pos_arg1); if (pos_arg2) - printf("positional arg 2 %s\n", pos_arg1); + printf("positional arg 2 %s\n", pos_arg2); for ( ; opt_index < argc ; opt_index ++) {