aboutsummaryrefslogtreecommitdiff
path: root/cmd-show-options.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2014-04-23 11:26:11 +0100
committerThomas Adam <thomas@xteddy.org>2014-04-23 11:26:11 +0100
commit953c3ef47a1933d38308075c1bacc7ea8d38301b (patch)
tree6484bdd51ecedbb5888717db271c151257ec87f5 /cmd-show-options.c
parent12e9c974fadc5ed6f0e7db10c40d5a0d55e0da8a (diff)
parent64613b9d411a7c76a50a2f9c66df345f082fce25 (diff)
downloadrtmux-953c3ef47a1933d38308075c1bacc7ea8d38301b.tar.gz
rtmux-953c3ef47a1933d38308075c1bacc7ea8d38301b.tar.bz2
rtmux-953c3ef47a1933d38308075c1bacc7ea8d38301b.zip
Merge branch 'obsd-master'
Conflicts: Makefile tmux.1 window.c
Diffstat (limited to 'cmd-show-options.c')
-rw-r--r--cmd-show-options.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/cmd-show-options.c b/cmd-show-options.c
index 943353f6..bf3cfef5 100644
--- a/cmd-show-options.c
+++ b/cmd-show-options.c
@@ -100,15 +100,17 @@ cmd_show_options_one(struct cmd *self, struct cmd_q *cmdq,
struct options *oo, int quiet)
{
struct args *args = self->args;
+ const char *name = args->argv[0];
const struct options_table_entry *table, *oe;
struct options_entry *o;
const char *optval;
- if (*args->argv[0] == '@') {
- if ((o = options_find1(oo, args->argv[0])) == NULL) {
+retry:
+ if (*name == '@') {
+ if ((o = options_find1(oo, name)) == NULL) {
if (quiet)
return (CMD_RETURN_NORMAL);
- cmdq_error(cmdq, "unknown option: %s", args->argv[0]);
+ cmdq_error(cmdq, "unknown option: %s", name);
return (CMD_RETURN_ERROR);
}
if (args_has(self->args, 'v'))
@@ -119,16 +121,20 @@ cmd_show_options_one(struct cmd *self, struct cmd_q *cmdq,
}
table = oe = NULL;
- if (options_table_find(args->argv[0], &table, &oe) != 0) {
- cmdq_error(cmdq, "ambiguous option: %s", args->argv[0]);
+ if (options_table_find(name, &table, &oe) != 0) {
+ cmdq_error(cmdq, "ambiguous option: %s", name);
return (CMD_RETURN_ERROR);
}
if (oe == NULL) {
if (quiet)
return (CMD_RETURN_NORMAL);
- cmdq_error(cmdq, "unknown option: %s", args->argv[0]);
+ cmdq_error(cmdq, "unknown option: %s", name);
return (CMD_RETURN_ERROR);
}
+ if (oe->style != NULL) {
+ name = oe->style;
+ goto retry;
+ }
if ((o = options_find1(oo, oe->name)) == NULL)
return (CMD_RETURN_NORMAL);
optval = options_table_print_entry(oe, o, args_has(self->args, 'v'));
@@ -157,6 +163,8 @@ cmd_show_options_all(struct cmd *self, struct cmd_q *cmdq,
}
for (oe = table; oe->name != NULL; oe++) {
+ if (oe->style != NULL)
+ continue;
if ((o = options_find1(oo, oe->name)) == NULL)
continue;
optval = options_table_print_entry(oe, o,