From d394293ba59fc932085eb8c01592822a9b1ec1f7 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 15 Sep 2023 06:31:49 +0000 Subject: Add -t to source-file, GitHub issue 3473. --- cmd-source-file.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'cmd-source-file.c') diff --git a/cmd-source-file.c b/cmd-source-file.c index 0bc02e05..38d56d31 100644 --- a/cmd-source-file.c +++ b/cmd-source-file.c @@ -36,8 +36,10 @@ const struct cmd_entry cmd_source_file_entry = { .name = "source-file", .alias = "source", - .args = { "Fnqv", 1, -1, NULL }, - .usage = "[-Fnqv] path ...", + .args = { "t:Fnqv", 1, -1, NULL }, + .usage = "[-Fnqv] " CMD_TARGET_PANE_USAGE " path ...", + + .target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL }, .flags = 0, .exec = cmd_source_file_exec @@ -93,6 +95,7 @@ cmd_source_file_done(struct client *c, const char *path, int error, size_t bsize = EVBUFFER_LENGTH(buffer); u_int n; struct cmdq_item *new_item; + struct cmd_find_state *target = cmdq_get_target(item); if (!closed) return; @@ -101,7 +104,7 @@ cmd_source_file_done(struct client *c, const char *path, int error, cmdq_error(item, "%s: %s", path, strerror(error)); else if (bsize != 0) { if (load_cfg_from_buffer(bdata, bsize, path, c, cdata->after, - cdata->flags, &new_item) < 0) + target, cdata->flags, &new_item) < 0) cdata->retval = CMD_RETURN_ERROR; else if (new_item != NULL) cdata->after = new_item; -- cgit v1.2.3