summaryrefslogtreecommitdiffstats
path: root/cmd-show-window-options.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-12-03 17:44:02 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-12-03 17:44:02 +0000
commit6c9862662fd2cccdc55be9d447a27b10f33ed8ea (patch)
treedc4e67793ad8556b91448ab61599bdb5e78c3e41 /cmd-show-window-options.c
parent6bbc92a6f5799f0c3d9ce4fc8c10c161598757be (diff)
Eliminate duplicate code and ease the passage for server-wide options by adding
a -w flag to set-option and show-options and making setw and showw aliases to set -w and show -w. Note: setw and showw are still there, but now aliases for set -w and show -w.
Diffstat (limited to 'cmd-show-window-options.c')
-rw-r--r--cmd-show-window-options.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/cmd-show-window-options.c b/cmd-show-window-options.c
index 2609cfab..b81f887c 100644
--- a/cmd-show-window-options.c
+++ b/cmd-show-window-options.c
@@ -24,7 +24,7 @@
#include "tmux.h"
/*
- * Show window options.
+ * Show window options. This is an alias for show-options -w.
*/
int cmd_show_window_options_exec(struct cmd *, struct cmd_ctx *);
@@ -44,26 +44,7 @@ int
cmd_show_window_options_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct cmd_target_data *data = self->data;
- struct winlink *wl;
- struct options *oo;
- struct options_entry *o;
- const struct set_option_entry *entry;
- const char *optval;
- if (cmd_check_flag(data->chflags, 'g'))
- oo = &global_w_options;
- else {
- if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL)
- return (-1);
- oo = &wl->window->options;
- }
-
- for (entry = set_window_option_table; entry->name != NULL; entry++) {
- if ((o = options_find1(oo, entry->name)) == NULL)
- continue;
- optval = set_option_print(entry, o);
- ctx->print(ctx, "%s %s", entry->name, optval);
- }
-
- return (0);
+ cmd_set_flag(&data->chflags, 'w');
+ return (cmd_show_options_entry.exec(self, ctx));
}