=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-set-option.c,v retrieving revision 1.60 retrieving revision 1.61 diff -c -r1.60 -r1.61 *** src/usr.bin/tmux/cmd-set-option.c 2013/03/24 09:54:10 1.60 --- src/usr.bin/tmux/cmd-set-option.c 2013/03/24 09:55:02 1.61 *************** *** 1,4 **** ! /* $OpenBSD: cmd-set-option.c,v 1.60 2013/03/24 09:54:10 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-set-option.c,v 1.61 2013/03/24 09:55:02 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 30,36 **** enum cmd_retval cmd_set_option_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_set_option_user(struct cmd *, struct cmd_q *, ! const char *, const char *); int cmd_set_option_unset(struct cmd *, struct cmd_q *, const struct options_table_entry *, struct options *, --- 30,36 ---- enum cmd_retval cmd_set_option_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_set_option_user(struct cmd *, struct cmd_q *, ! const char *, const char *); int cmd_set_option_unset(struct cmd *, struct cmd_q *, const struct options_table_entry *, struct options *, *************** *** 63,70 **** const struct cmd_entry cmd_set_option_entry = { "set-option", "set", ! "agqst:uw", 1, 2, ! "[-agsquw] [-t target-session|target-window] option [value]", 0, NULL, NULL, --- 63,70 ---- const struct cmd_entry cmd_set_option_entry = { "set-option", "set", ! "agoqst:uw", 1, 2, ! "[-agosquw] [-t target-session|target-window] option [value]", 0, NULL, NULL, *************** *** 73,80 **** const struct cmd_entry cmd_set_window_option_entry = { "set-window-option", "setw", ! "agqt:u", 1, 2, ! "[-agqu] " CMD_TARGET_WINDOW_USAGE " option [value]", 0, NULL, NULL, --- 73,80 ---- const struct cmd_entry cmd_set_window_option_entry = { "set-window-option", "setw", ! "agoqt:u", 1, 2, ! "[-agoqu] " CMD_TARGET_WINDOW_USAGE " option [value]", 0, NULL, NULL, *************** *** 151,156 **** --- 151,161 ---- if (cmd_set_option_unset(self, cmdq, oe, oo, valstr) != 0) return (CMD_RETURN_ERROR); } else { + if (args_has(args, 'o') && options_find1(oo, optstr) != NULL) { + if (!args_has(args, 'q')) + cmdq_print(cmdq, "already set: %s", optstr); + return (CMD_RETURN_NORMAL); + } if (cmd_set_option_set(self, cmdq, oe, oo, valstr) != 0) return (CMD_RETURN_ERROR); } *************** *** 226,231 **** --- 231,241 ---- if (valstr == NULL) { cmdq_error(cmdq, "empty value"); return (CMD_RETURN_ERROR); + } + if (args_has(args, 'o') && options_find1(oo, optstr) != NULL) { + if (!args_has(args, 'q')) + cmdq_print(cmdq, "already set: %s", optstr); + return (CMD_RETURN_NORMAL); } options_set_string(oo, optstr, "%s", valstr); if (!args_has(args, 'q')) {