Add cmdq as an argument to format_create and add a format for the

command name (will also be used for more later).
This commit is contained in:
nicm
2015-12-11 12:27:36 +00:00
parent e0f26dcda3
commit 01831da5f5
23 changed files with 32 additions and 28 deletions

View File

@ -465,7 +465,7 @@ format_cb_pane_tabs(struct format_tree *ft, struct format_entry *fe)
/* Create a new tree. */
struct format_tree *
format_create(int flags)
format_create(struct cmd_q *cmdq, int flags)
{
struct format_tree *ft;
@ -484,6 +484,9 @@ format_create(int flags)
format_add(ft, "socket_path", "%s", socket_path);
format_add_tv(ft, "start_time", &start_time);
if (cmdq != NULL && cmdq->cmd != NULL)
format_add(ft, "command_name", "%s", cmdq->cmd->entry->name);
return (ft);
}