The branch, hooks has been updated
       via  82901f05a7249fb29df380f3b352c2308adff67c (commit)
       via  928edf51564987e9e2a2fd11e7bd0feffd3ebf4d (commit)
       via  7b43900f295ecd72113d94f6c56da8171530be76 (commit)
      from  0a89fc921d6352ecf612a9413200d974729ab7d8 (commit)

- Log -----------------------------------------------------------------
commit 82901f05a7249fb29df380f3b352c2308adff67c
Author: Thomas Adam <tho...@xteddy.org>
Commit: Thomas Adam <tho...@xteddy.org>

    Convert display-message to use prepare flags
---
 cmd-display-message.c |   32 +++++---------------------------
 1 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/cmd-display-message.c b/cmd-display-message.c
index f3547b0..64f81dd 100644
--- a/cmd-display-message.c
+++ b/cmd-display-message.c
@@ -39,7 +39,7 @@ const struct cmd_entry cmd_display_message_entry = {
        "c:pt:F:", 0, 1,
        "[-p] [-c target-client] [-F format] " CMD_TARGET_PANE_USAGE
        " [message]",
-       0,
+       CMD_PREP_CLIENT_C|CMD_PREP_PANE_T,
        cmd_display_message_exec
 };
 
@@ -47,10 +47,10 @@ enum cmd_retval
 cmd_display_message_exec(struct cmd *self, struct cmd_q *cmdq)
 {
        struct args             *args = self->args;
-       struct client           *c;
-       struct session          *s;
-       struct winlink          *wl;
-       struct window_pane      *wp;
+       struct client           *c = cmdq->state.c;
+       struct session          *s = cmdq->state.tflag.s;
+       struct winlink          *wl = cmdq->state.tflag.wl;
+       struct window_pane      *wp = cmdq->state.tflag.wp;
        const char              *template;
        char                    *msg;
        struct format_tree      *ft;
@@ -58,33 +58,11 @@ cmd_display_message_exec(struct cmd *self, struct cmd_q 
*cmdq)
        time_t                   t;
        size_t                   len;
 
-       if (args_has(args, 't')) {
-               wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp);
-               if (wl == NULL)
-                       return (CMD_RETURN_ERROR);
-       } else {
-               wl = cmd_find_pane(cmdq, NULL, &s, &wp);
-               if (wl == NULL)
-                       return (CMD_RETURN_ERROR);
-       }
-
        if (args_has(args, 'F') && args->argc != 0) {
                cmdq_error(cmdq, "only one of -F or argument must be given");
                return (CMD_RETURN_ERROR);
        }
 
-       if (args_has(args, 'c')) {
-               c = cmd_find_client(cmdq, args_get(args, 'c'), 0);
-               if (c == NULL)
-                       return (CMD_RETURN_ERROR);
-       } else {
-               c = cmd_current_client(cmdq);
-               if (c == NULL && !args_has(self->args, 'p')) {
-                       cmdq_error(cmdq, "no client available");
-                       return (CMD_RETURN_ERROR);
-               }
-       }
-
        template = args_get(args, 'F');
        if (args->argc != 0)
                template = args->argv[0];


commit 928edf51564987e9e2a2fd11e7bd0feffd3ebf4d
Author: Thomas Adam <tho...@xteddy.org>
Commit: Thomas Adam <tho...@xteddy.org>

    Convert confirm-before to use prepare flags
---
 cmd-confirm-before.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/cmd-confirm-before.c b/cmd-confirm-before.c
index 0bf5844..b9b505c 100644
--- a/cmd-confirm-before.c
+++ b/cmd-confirm-before.c
@@ -37,7 +37,7 @@ const struct cmd_entry cmd_confirm_before_entry = {
        "confirm-before", "confirm",
        "p:t:", 1, 1,
        "[-p prompt] " CMD_TARGET_CLIENT_USAGE " command",
-       0,
+       CMD_PREP_CLIENT_T,
        cmd_confirm_before_exec
 };
 
@@ -51,13 +51,10 @@ cmd_confirm_before_exec(struct cmd *self, struct cmd_q 
*cmdq)
 {
        struct args                     *args = self->args;
        struct cmd_confirm_before_data  *cdata;
-       struct client                   *c;
+       struct client                   *c = cmdq->state.c;
        char                            *cmd, *copy, *new_prompt, *ptr;
        const char                      *prompt;
 
-       if ((c = cmd_find_client(cmdq, args_get(args, 't'), 0)) == NULL)
-               return (CMD_RETURN_ERROR);
-
        if ((prompt = args_get(args, 'p')) != NULL)
                xasprintf(&new_prompt, "%s ", prompt);
        else {


commit 7b43900f295ecd72113d94f6c56da8171530be76
Author: Thomas Adam <tho...@xteddy.org>
Commit: Thomas Adam <tho...@xteddy.org>

    Convert command-prompt to use prepare flags
---
 cmd-command-prompt.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/cmd-command-prompt.c b/cmd-command-prompt.c
index 22b1d84..4728235 100644
--- a/cmd-command-prompt.c
+++ b/cmd-command-prompt.c
@@ -38,7 +38,7 @@ const struct cmd_entry cmd_command_prompt_entry = {
        "command-prompt", NULL,
        "I:p:t:", 0, 1,
        "[-I inputs] [-p prompts] " CMD_TARGET_CLIENT_USAGE " [template]",
-       0,
+       CMD_PREP_CLIENT_T,
        cmd_command_prompt_exec
 };
 
@@ -58,13 +58,10 @@ cmd_command_prompt_exec(struct cmd *self, struct cmd_q 
*cmdq)
        struct args                     *args = self->args;
        const char                      *inputs, *prompts;
        struct cmd_command_prompt_cdata *cdata;
-       struct client                   *c;
+       struct client                   *c = cmdq->state.c;
        char                            *prompt, *ptr, *input = NULL;
        size_t                           n;
 
-       if ((c = cmd_find_client(cmdq, args_get(args, 't'), 0)) == NULL)
-               return (CMD_RETURN_ERROR);
-
        if (c->prompt_string != NULL)
                return (CMD_RETURN_NORMAL);
 


-----------------------------------------------------------------------

Summary of changes:
 cmd-command-prompt.c  |    7 ++-----
 cmd-confirm-before.c  |    7 ++-----
 cmd-display-message.c |   32 +++++---------------------------
 3 files changed, 9 insertions(+), 37 deletions(-)


hooks/post-receive
-- 
tmux

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
tmux-cvs mailing list
tmux-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to