diff options
author | nicm <nicm> | 2017-01-24 19:11:46 +0000 |
---|---|---|
committer | nicm <nicm> | 2017-01-24 19:11:46 +0000 |
commit | 61fce272ea60f5096711ee554c56aef9cca8c654 (patch) | |
tree | aab0f65300ba9d33dfb7798d02aeacfb00164aa7 /cmd-show-options.c | |
parent | 3d74e89a395838e5c9c4ea101a9366be09bf03c7 (diff) | |
download | rtmux-61fce272ea60f5096711ee554c56aef9cca8c654.tar.gz rtmux-61fce272ea60f5096711ee554c56aef9cca8c654.tar.bz2 rtmux-61fce272ea60f5096711ee554c56aef9cca8c654.zip |
If given an array option without an index either show or set all items,
and support -a for array options. Allow the separator for set to be
specified in the options table (will be used for backwards compatibility
later).
Diffstat (limited to 'cmd-show-options.c')
-rw-r--r-- | cmd-show-options.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd-show-options.c b/cmd-show-options.c index f7df2b11..b9882243 100644 --- a/cmd-show-options.c +++ b/cmd-show-options.c @@ -92,11 +92,20 @@ cmd_show_options_print(struct cmd *self, struct cmdq_item *item, const char *name; const char *value; char *tmp, *escaped; + u_int size, i; if (idx != -1) { xasprintf(&tmp, "%s[%d]", options_name(o), idx); name = tmp; } else { + if (options_array_size(o, &size) != -1) { + for (i = 0; i < size; i++) { + if (options_array_get(o, i) == NULL) + continue; + cmd_show_options_print(self, item, o, i); + } + return; + } tmp = NULL; name = options_name(o); } |