diff options
author | 2011-01-04 02:03:41 +0000 | |
---|---|---|
committer | 2011-01-04 02:03:41 +0000 | |
commit | 71730f1303610f329d9fecdbc9be768d0c596955 (patch) | |
tree | 6060749c2451828cd8ceb7799571bb625f6ffc84 /usr.bin/tmux/cmd-set-option.c | |
parent | Fix stupid commit error pointed out by guenther@ (thanks!): (diff) | |
download | wireguard-openbsd-71730f1303610f329d9fecdbc9be768d0c596955.tar.xz wireguard-openbsd-71730f1303610f329d9fecdbc9be768d0c596955.zip |
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 'usr.bin/tmux/cmd-set-option.c')
-rw-r--r-- | usr.bin/tmux/cmd-set-option.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-set-option.c b/usr.bin/tmux/cmd-set-option.c index 3a8c7ef35ac..daf05d4307d 100644 --- a/usr.bin/tmux/cmd-set-option.c +++ b/usr.bin/tmux/cmd-set-option.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-set-option.c,v 1.45 2011/01/04 01:58:12 nicm Exp $ */ +/* $OpenBSD: cmd-set-option.c,v 1.46 2011/01/04 02:03:41 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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; |