From 0d84fdd95303a6ed4dcd761425e35f3731b86725 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 29 Apr 2016 14:05:24 +0000 Subject: Final parts of command hooks, add before- and after- hooks to each command. --- format.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'format.c') diff --git a/format.c b/format.c index 78c177cd..d2b75b9b 100644 --- a/format.c +++ b/format.c @@ -468,6 +468,7 @@ struct format_tree * format_create(struct cmd_q *cmdq, int flags) { struct format_tree *ft; + struct cmd *cmd; if (!event_initialized(&format_job_event)) { evtimer_set(&format_job_event, format_job_timer, NULL); @@ -486,6 +487,10 @@ format_create(struct cmd_q *cmdq, int flags) if (cmdq != NULL && cmdq->cmd != NULL) format_add(ft, "command_name", "%s", cmdq->cmd->entry->name); + if (cmdq != NULL && cmdq->parent != NULL) { + cmd = cmdq->parent->cmd; + format_add(ft, "command_hooked", "%s", cmd->entry->name); + } return (ft); } -- cgit