summaryrefslogtreecommitdiffstats
path: root/cmd-set-option.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2011-01-04 02:03:41 +0000
committerNicholas Marriott <nicm@openbsd.org>2011-01-04 02:03:41 +0000
commit96c37fa80a46e189b9b6535242aa1966f4d375c8 (patch)
tree38f3b6c86abbddd1388528b39f70380ee6661c54 /cmd-set-option.c
parent55346b0d103016e8ee633e08e41b8b977b5904ef (diff)
Now that parsing is common, merge some of the small, related commands
together to use the same code. Also add some arguments (such as -n and -p) to some commands to match existing commands.
Diffstat (limited to 'cmd-set-option.c')
-rw-r--r--cmd-set-option.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c
index efd5797a..436e529e 100644
--- a/cmd-set-option.c
+++ b/cmd-set-option.c
@@ -68,6 +68,16 @@ const struct cmd_entry cmd_set_option_entry = {
cmd_set_option_exec
};
+const struct cmd_entry cmd_set_window_option_entry = {
+ "set-window-option", "setw",
+ "agt:u", 1, 2,
+ "[-agu] " CMD_TARGET_WINDOW_USAGE " option [value]",
+ 0,
+ NULL,
+ NULL,
+ cmd_set_option_exec
+};
+
int
cmd_set_option_exec(struct cmd *self, struct cmd_ctx *ctx)
{
@@ -87,7 +97,8 @@ cmd_set_option_exec(struct cmd *self, struct cmd_ctx *ctx)
if (args_has(self->args, 's')) {
oo = &global_options;
table = server_options_table;
- } else if (args_has(self->args, 'w')) {
+ } else if (args_has(self->args, 'w') ||
+ self->entry == &cmd_set_window_option_entry) {
table = window_options_table;
if (args_has(self->args, 'g'))
oo = &global_w_options;