diff options
author | Thomas Adam <thomas@xteddy.org> | 2021-08-25 12:01:11 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2021-08-25 12:01:11 +0100 |
commit | c6375a0d4003d1008bb64e96e9c0c4433e4a5d13 (patch) | |
tree | ac84b463df1f905b68cfce14c68a1bfe3d543b05 /cmd-run-shell.c | |
parent | 6616b42b2c28cd7a1b6d52dfc895f5a1d3dce8b3 (diff) | |
parent | 24636be42b4b0463afe5c72e1d982f28729a0579 (diff) | |
download | rtmux-c6375a0d4003d1008bb64e96e9c0c4433e4a5d13.tar.gz rtmux-c6375a0d4003d1008bb64e96e9c0c4433e4a5d13.tar.bz2 rtmux-c6375a0d4003d1008bb64e96e9c0c4433e4a5d13.zip |
Merge branch 'obsd-master' into master
Diffstat (limited to 'cmd-run-shell.c')
-rw-r--r-- | cmd-run-shell.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/cmd-run-shell.c b/cmd-run-shell.c index f23a8ec3..662312fb 100644 --- a/cmd-run-shell.c +++ b/cmd-run-shell.c @@ -30,7 +30,10 @@ * Runs a command without a window. */ -static enum cmd_retval cmd_run_shell_exec(struct cmd *, struct cmdq_item *); +static enum args_parse_type cmd_run_shell_args_parse(struct args *, u_int, + char **); +static enum cmd_retval cmd_run_shell_exec(struct cmd *, + struct cmdq_item *); static void cmd_run_shell_timer(int, short, void *); static void cmd_run_shell_callback(struct job *); @@ -41,7 +44,7 @@ const struct cmd_entry cmd_run_shell_entry = { .name = "run-shell", .alias = "run", - .args = { "bd:Ct:", 0, 1, NULL }, + .args = { "bd:Ct:", 0, 1, cmd_run_shell_args_parse }, .usage = "[-bC] [-d delay] " CMD_TARGET_PANE_USAGE " [shell-command]", .target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL }, @@ -62,6 +65,15 @@ struct cmd_run_shell_data { int flags; }; +static enum args_parse_type +cmd_run_shell_args_parse(struct args *args, __unused u_int idx, + __unused char **cause) +{ + if (args_has(args, 'C')) + return (ARGS_PARSE_COMMANDS_OR_STRING); + return (ARGS_PARSE_STRING); +} + static void cmd_run_shell_print(struct job *job, const char *msg) { |