aboutsummaryrefslogtreecommitdiff
path: root/cmd-command-prompt.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2021-08-25 12:01:11 +0100
committerThomas Adam <thomas@xteddy.org>2021-08-25 12:01:11 +0100
commitc6375a0d4003d1008bb64e96e9c0c4433e4a5d13 (patch)
treeac84b463df1f905b68cfce14c68a1bfe3d543b05 /cmd-command-prompt.c
parent6616b42b2c28cd7a1b6d52dfc895f5a1d3dce8b3 (diff)
parent24636be42b4b0463afe5c72e1d982f28729a0579 (diff)
downloadrtmux-c6375a0d4003d1008bb64e96e9c0c4433e4a5d13.tar.gz
rtmux-c6375a0d4003d1008bb64e96e9c0c4433e4a5d13.tar.bz2
rtmux-c6375a0d4003d1008bb64e96e9c0c4433e4a5d13.zip
Merge branch 'obsd-master' into master
Diffstat (limited to 'cmd-command-prompt.c')
-rw-r--r--cmd-command-prompt.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/cmd-command-prompt.c b/cmd-command-prompt.c
index bca1a7fc..737c44c7 100644
--- a/cmd-command-prompt.c
+++ b/cmd-command-prompt.c
@@ -29,8 +29,10 @@
* Prompt for command in client.
*/
-static enum cmd_retval cmd_command_prompt_exec(struct cmd *,
- struct cmdq_item *);
+static enum args_parse_type cmd_command_prompt_args_parse(struct args *,
+ u_int, char **);
+static enum cmd_retval cmd_command_prompt_exec(struct cmd *,
+ struct cmdq_item *);
static int cmd_command_prompt_callback(struct client *, void *,
const char *, int);
@@ -40,7 +42,7 @@ const struct cmd_entry cmd_command_prompt_entry = {
.name = "command-prompt",
.alias = NULL,
- .args = { "1bFkiI:Np:t:T:", 0, 1, NULL },
+ .args = { "1bFkiI:Np:t:T:", 0, 1, cmd_command_prompt_args_parse },
.usage = "[-1bFkiN] [-I inputs] [-p prompts] " CMD_TARGET_CLIENT_USAGE
" [-T type] [template]",
@@ -68,6 +70,13 @@ struct cmd_command_prompt_cdata {
char **argv;
};
+static enum args_parse_type
+cmd_command_prompt_args_parse(__unused struct args *args, __unused u_int idx,
+ __unused char **cause)
+{
+ return (ARGS_PARSE_COMMANDS_OR_STRING);
+}
+
static enum cmd_retval
cmd_command_prompt_exec(struct cmd *self, struct cmdq_item *item)
{
@@ -197,8 +206,8 @@ cmd_command_prompt_callback(struct client *c, void *data, const char *s,
return (1);
out:
- if (item != NULL)
- cmdq_continue(item);
+ if (item != NULL)
+ cmdq_continue(item);
return (0);
}