aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJani Nikula <jani@nikula.org>2017-10-01 23:53:13 +0300
committerDavid Bremner <david@tethera.net>2017-10-04 22:01:15 -0300
commit25960b5ecdc6374fc87a3cb12c1c393497b262da (patch)
treeff19a184c2da68fba66747e843e442eb9a2c454b
parente8cba9da18a8ed946738fdd9f47d117c1110c1b4 (diff)
test: add opt_inherit to arg-test
Just split the arguments to two opt desc arrays.
-rw-r--r--test/arg-test.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/test/arg-test.c b/test/arg-test.c
index 9d13618b..a379f23e 100644
--- a/test/arg-test.c
+++ b/test/arg-test.c
@@ -14,18 +14,23 @@ int main(int argc, char **argv){
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 },
- { 0, 0 } } },
+ notmuch_opt_desc_t parent_options[] = {
{ .opt_flags = &fl_val, .name = "flag", .keywords =
(notmuch_keyword_t []){ { "one", 1 << 0},
{ "two", 1 << 1 },
{ "three", 1 << 2 },
{ 0, 0 } } },
{ .opt_int = &int_val, .name = "int" },
+ { }
+ };
+
+ 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 },
+ { 0, 0 } } },
+ { .opt_inherit = parent_options },
{ .opt_string = &string_val, .name = "string" },
{ .opt_position = &pos_arg1 },
{ .opt_position = &pos_arg2 },