mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
Hide struct args behind a couple of accessor functions.
This commit is contained in:
@ -68,9 +68,9 @@ cmd_display_message_exec(struct cmd *self, struct cmdq_item *item)
|
||||
struct window_pane *wp = target->wp;
|
||||
const char *template;
|
||||
char *msg, *cause;
|
||||
int delay = -1;
|
||||
int delay = -1, flags;
|
||||
struct format_tree *ft;
|
||||
int flags;
|
||||
u_int count = args_count(args);
|
||||
|
||||
if (args_has(args, 'I')) {
|
||||
if (wp == NULL)
|
||||
@ -83,7 +83,7 @@ cmd_display_message_exec(struct cmd *self, struct cmdq_item *item)
|
||||
return (CMD_RETURN_WAIT);
|
||||
}
|
||||
|
||||
if (args_has(args, 'F') && args->argc != 0) {
|
||||
if (args_has(args, 'F') && count != 0) {
|
||||
cmdq_error(item, "only one of -F or argument must be given");
|
||||
return (CMD_RETURN_ERROR);
|
||||
}
|
||||
@ -97,9 +97,10 @@ cmd_display_message_exec(struct cmd *self, struct cmdq_item *item)
|
||||
}
|
||||
}
|
||||
|
||||
template = args_get(args, 'F');
|
||||
if (args->argc != 0)
|
||||
template = args->argv[0];
|
||||
if (count != 0)
|
||||
template = args_string(args, 0);
|
||||
else
|
||||
template = args_get(args, 'F');
|
||||
if (template == NULL)
|
||||
template = DISPLAY_MESSAGE_TEMPLATE;
|
||||
|
||||
|
Reference in New Issue
Block a user