mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 04:18:08 +01:00
test: add opt_inherit to arg-test
Just split the arguments to two opt desc arrays.
This commit is contained in:
parent
e8cba9da18
commit
25960b5ecd
1 changed files with 11 additions and 6 deletions
|
@ -14,18 +14,23 @@ int main(int argc, char **argv){
|
||||||
const char *string_val=NULL;
|
const char *string_val=NULL;
|
||||||
notmuch_bool_t bool_val = FALSE;
|
notmuch_bool_t bool_val = FALSE;
|
||||||
|
|
||||||
notmuch_opt_desc_t options[] = {
|
notmuch_opt_desc_t parent_options[] = {
|
||||||
{ .opt_bool = &bool_val, .name = "boolean" },
|
|
||||||
{ .opt_keyword = &kw_val, .name = "keyword", .keywords =
|
|
||||||
(notmuch_keyword_t []){ { "one", 1 },
|
|
||||||
{ "two", 2 },
|
|
||||||
{ 0, 0 } } },
|
|
||||||
{ .opt_flags = &fl_val, .name = "flag", .keywords =
|
{ .opt_flags = &fl_val, .name = "flag", .keywords =
|
||||||
(notmuch_keyword_t []){ { "one", 1 << 0},
|
(notmuch_keyword_t []){ { "one", 1 << 0},
|
||||||
{ "two", 1 << 1 },
|
{ "two", 1 << 1 },
|
||||||
{ "three", 1 << 2 },
|
{ "three", 1 << 2 },
|
||||||
{ 0, 0 } } },
|
{ 0, 0 } } },
|
||||||
{ .opt_int = &int_val, .name = "int" },
|
{ .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_string = &string_val, .name = "string" },
|
||||||
{ .opt_position = &pos_arg1 },
|
{ .opt_position = &pos_arg1 },
|
||||||
{ .opt_position = &pos_arg2 },
|
{ .opt_position = &pos_arg2 },
|
||||||
|
|
Loading…
Reference in a new issue