aboutsummaryrefslogtreecommitdiff
path: root/cmd-set-option.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2021-08-25 12:01:11 +0100
committerThomas Adam <thomas@xteddy.org>2021-08-25 12:01:11 +0100
commitc6375a0d4003d1008bb64e96e9c0c4433e4a5d13 (patch)
treeac84b463df1f905b68cfce14c68a1bfe3d543b05 /cmd-set-option.c
parent6616b42b2c28cd7a1b6d52dfc895f5a1d3dce8b3 (diff)
parent24636be42b4b0463afe5c72e1d982f28729a0579 (diff)
downloadrtmux-c6375a0d4003d1008bb64e96e9c0c4433e4a5d13.tar.gz
rtmux-c6375a0d4003d1008bb64e96e9c0c4433e4a5d13.tar.bz2
rtmux-c6375a0d4003d1008bb64e96e9c0c4433e4a5d13.zip
Merge branch 'obsd-master' into master
Diffstat (limited to 'cmd-set-option.c')
-rw-r--r--cmd-set-option.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c
index 8839dc0d..fbe32cfa 100644
--- a/cmd-set-option.c
+++ b/cmd-set-option.c
@@ -27,13 +27,16 @@
* Set an option.
*/
-static enum cmd_retval cmd_set_option_exec(struct cmd *, struct cmdq_item *);
+static enum args_parse_type cmd_set_option_args_parse(struct args *,
+ u_int, char **);
+static enum cmd_retval cmd_set_option_exec(struct cmd *,
+ struct cmdq_item *);
const struct cmd_entry cmd_set_option_entry = {
.name = "set-option",
.alias = "set",
- .args = { "aFgopqst:uUw", 1, 2, NULL },
+ .args = { "aFgopqst:uUw", 1, 2, cmd_set_option_args_parse },
.usage = "[-aFgopqsuUw] " CMD_TARGET_PANE_USAGE " option [value]",
.target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL },
@@ -46,7 +49,7 @@ const struct cmd_entry cmd_set_window_option_entry = {
.name = "set-window-option",
.alias = "setw",
- .args = { "aFgoqt:u", 1, 2, NULL },
+ .args = { "aFgoqt:u", 1, 2, cmd_set_option_args_parse },
.usage = "[-aFgoqu] " CMD_TARGET_WINDOW_USAGE " option [value]",
.target = { 't', CMD_FIND_WINDOW, CMD_FIND_CANFAIL },
@@ -59,7 +62,7 @@ const struct cmd_entry cmd_set_hook_entry = {
.name = "set-hook",
.alias = NULL,
- .args = { "agpRt:uw", 1, 2, NULL },
+ .args = { "agpRt:uw", 1, 2, cmd_set_option_args_parse },
.usage = "[-agpRuw] " CMD_TARGET_PANE_USAGE " hook [command]",
.target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL },
@@ -68,6 +71,15 @@ const struct cmd_entry cmd_set_hook_entry = {
.exec = cmd_set_option_exec
};
+static enum args_parse_type
+cmd_set_option_args_parse(__unused struct args *args, u_int idx,
+ __unused char **cause)
+{
+ if (idx == 1)
+ return (ARGS_PARSE_COMMANDS_OR_STRING);
+ return (ARGS_PARSE_STRING);
+}
+
static enum cmd_retval
cmd_set_option_exec(struct cmd *self, struct cmdq_item *item)
{