diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-04-22 10:22:40 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-04-22 10:22:40 +0000 |
commit | 3b5031a1e691e18e1bbe892b262d81db17887237 (patch) | |
tree | 280122dc6016981c484998db1ba10afbfdadb998 /usr.bin/tmux/cmd-pipe-pane.c | |
parent | 61be04363b84fafcbfe17c4d58547b1ca814e2c7 (diff) |
Get rid of the extra layer of flags and cmd_prepare() and just store the
CMD_FIND_* flags in the cmd_entry and call it for the command. Commands
with special requirements call it themselves and update the target for
hooks to use.
Diffstat (limited to 'usr.bin/tmux/cmd-pipe-pane.c')
-rw-r--r-- | usr.bin/tmux/cmd-pipe-pane.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/tmux/cmd-pipe-pane.c b/usr.bin/tmux/cmd-pipe-pane.c index 4eb6f567eb2..7ed9284ccd2 100644 --- a/usr.bin/tmux/cmd-pipe-pane.c +++ b/usr.bin/tmux/cmd-pipe-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-pipe-pane.c,v 1.40 2017/02/03 11:57:27 nicm Exp $ */ +/* $OpenBSD: cmd-pipe-pane.c,v 1.41 2017/04/22 10:22:39 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -44,7 +44,7 @@ const struct cmd_entry cmd_pipe_pane_entry = { .args = { "ot:", 0, 1 }, .usage = "[-o] " CMD_TARGET_PANE_USAGE " [command]", - .tflag = CMD_PANE, + .target = { 't', CMD_FIND_PANE, 0 }, .flags = CMD_AFTERHOOK, .exec = cmd_pipe_pane_exec @@ -54,10 +54,10 @@ static enum cmd_retval cmd_pipe_pane_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; - struct client *c = item->state.c; - struct window_pane *wp = item->state.tflag.wp; - struct session *s = item->state.tflag.s; - struct winlink *wl = item->state.tflag.wl; + struct client *c = cmd_find_client(item, NULL, 1); + struct window_pane *wp = item->target.wp; + struct session *s = item->target.s; + struct winlink *wl = item->target.wl; char *cmd; int old_fd, pipe_fd[2], null_fd; struct format_tree *ft; |