aboutsummaryrefslogtreecommitdiff
path: root/test/arg-test.c
diff options
context:
space:
mode:
authorJani Nikula <jani@nikula.org>2017-10-01 23:53:12 +0300
committerDavid Bremner <david@tethera.net>2017-10-04 22:00:54 -0300
commite8cba9da18a8ed946738fdd9f47d117c1110c1b4 (patch)
tree7fb57ee3d311a1dd55ca21cb713e29b07006b87f /test/arg-test.c
parent4a6721970a42a9f86149fb5d395d1001fed2d305 (diff)
test: add boolean argument to arg-test
Surprisingly it's not there.
Diffstat (limited to 'test/arg-test.c')
-rw-r--r--test/arg-test.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/arg-test.c b/test/arg-test.c
index 10dc0683..9d13618b 100644
--- a/test/arg-test.c
+++ b/test/arg-test.c
@@ -12,8 +12,10 @@ int main(int argc, char **argv){
const char *pos_arg1=NULL;
const char *pos_arg2=NULL;
const char *string_val=NULL;
+ notmuch_bool_t bool_val = FALSE;
notmuch_opt_desc_t options[] = {
+ { .opt_bool = &bool_val, .name = "boolean" },
{ .opt_keyword = &kw_val, .name = "keyword", .keywords =
(notmuch_keyword_t []){ { "one", 1 },
{ "two", 2 },
@@ -35,6 +37,9 @@ int main(int argc, char **argv){
if (opt_index < 0)
return 1;
+ if (bool_val)
+ printf("boolean %d\n", bool_val);
+
if (kw_val)
printf("keyword %d\n", kw_val);