diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2013-07-05 15:10:38 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2013-07-05 15:10:38 +0000 |
commit | a96a8a1aabd64f0d79602ed7248cf73655066d92 (patch) | |
tree | c78bbdef4e34d153d39da2f15817850580e0ca40 /cmd-set-option.c | |
parent | 064124cc5f3df250f0f866ae1df7bc4cd19bf833 (diff) | |
download | rtmux-a96a8a1aabd64f0d79602ed7248cf73655066d92.tar.gz rtmux-a96a8a1aabd64f0d79602ed7248cf73655066d92.tar.bz2 rtmux-a96a8a1aabd64f0d79602ed7248cf73655066d92.zip |
Clarify error messages when setting options, from Thomas Adam.
Diffstat (limited to 'cmd-set-option.c')
-rw-r--r-- | cmd-set-option.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c index 6c0fefbf..3b822d8b 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 { |