=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-set-option.c,v retrieving revision 1.140 retrieving revision 1.141 diff -c -r1.140 -r1.141 *** src/usr.bin/tmux/cmd-set-option.c 2021/08/21 10:22:39 1.140 --- src/usr.bin/tmux/cmd-set-option.c 2021/08/25 08:51:55 1.141 *************** *** 1,4 **** ! /* $OpenBSD: cmd-set-option.c,v 1.140 2021/08/21 10:22:39 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-set-option.c,v 1.141 2021/08/25 08:51:55 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 27,39 **** * Set an option. */ ! 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 }, .usage = "[-aFgopqsuUw] " CMD_TARGET_PANE_USAGE " option [value]", .target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL }, --- 27,42 ---- * Set an option. */ ! 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, cmd_set_option_args_parse }, .usage = "[-aFgopqsuUw] " CMD_TARGET_PANE_USAGE " option [value]", .target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL }, *************** *** 46,52 **** .name = "set-window-option", .alias = "setw", ! .args = { "aFgoqt:u", 1, 2, NULL }, .usage = "[-aFgoqu] " CMD_TARGET_WINDOW_USAGE " option [value]", .target = { 't', CMD_FIND_WINDOW, CMD_FIND_CANFAIL }, --- 49,55 ---- .name = "set-window-option", .alias = "setw", ! .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,65 **** .name = "set-hook", .alias = NULL, ! .args = { "agpRt:uw", 1, 2, NULL }, .usage = "[-agpRuw] " CMD_TARGET_PANE_USAGE " hook [command]", .target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL }, --- 62,68 ---- .name = "set-hook", .alias = 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 }, *************** *** 67,72 **** --- 70,84 ---- .flags = CMD_AFTERHOOK, .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)