aboutsummaryrefslogtreecommitdiff
path: root/cmd-set-option.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2013-07-06 11:18:49 +0100
committerThomas Adam <thomas@xteddy.org>2013-07-06 11:18:49 +0100
commitbdea2f9eda1abc8f4a6c423af62ef7538b2ad249 (patch)
treef634639dad6a8775aa4692702b11a52f27aecac5 /cmd-set-option.c
parente496a548d7b07c9a4be9ce8e750cf5423e3bafe3 (diff)
parentf5b041e3949e9a129d68d9919725c3afcd81ed5a (diff)
downloadrtmux-bdea2f9eda1abc8f4a6c423af62ef7538b2ad249.tar.gz
rtmux-bdea2f9eda1abc8f4a6c423af62ef7538b2ad249.tar.bz2
rtmux-bdea2f9eda1abc8f4a6c423af62ef7538b2ad249.zip
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-set-option.c')
-rw-r--r--cmd-set-option.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c
index a46460a8..c246743c 100644
--- a/cmd-set-option.c
+++ b/cmd-set-option.c
@@ -128,8 +128,13 @@ cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq)
oo = &global_w_options;
else {
wl = cmd_find_window(cmdq, args_get(args, 't'), NULL);
- if (wl == NULL)
+ if (wl == NULL) {
+ cmdq_error(cmdq,
+ "couldn't set '%s'%s", optstr,
+ (!args_has(args, 't') && !args_has(args,
+ 'g')) ? " need target window or -g" : "");
return (CMD_RETURN_ERROR);
+ }
oo = &wl->window->options;
}
} else if (table == session_options_table) {
@@ -137,8 +142,13 @@ cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq)
oo = &global_s_options;
else {
s = cmd_find_session(cmdq, args_get(args, 't'), 0);
- if (s == NULL)
+ if (s == NULL) {
+ cmdq_error(cmdq,
+ "couldn't set '%s'%s", optstr,
+ (!args_has(args, 't') && !args_has(args,
+ 'g')) ? " need target session or -g" : "");
return (CMD_RETURN_ERROR);
+ }
oo = &s->options;
}
} else {