Replace %% in command lists (by copying them) for template arguments ,

this means they can be used with {} as well. Also make argument
processing from an existing vector preserve commands. GitHub issue 2858.
This commit is contained in:
nicm
2021-08-27 17:25:55 +00:00
parent fd756a150b
commit daec63e5e6
16 changed files with 324 additions and 150 deletions

View File

@ -40,7 +40,7 @@ const struct cmd_entry cmd_new_window_entry = {
.args = { "abc:de:F:kn:PSt:", 0, -1, NULL },
.usage = "[-abdkPS] [-c start-directory] [-e environment] [-F format] "
"[-n window-name] " CMD_TARGET_WINDOW_USAGE " [command]",
"[-n window-name] " CMD_TARGET_WINDOW_USAGE " [shell-command]",
.target = { 't', CMD_FIND_WINDOW, CMD_FIND_WINDOW_INDEX },
@ -105,7 +105,7 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item)
sc.tc = tc;
sc.name = args_get(args, 'n');
args_vector(args, &sc.argc, &sc.argv);
args_to_vector(args, &sc.argc, &sc.argv);
sc.environ = environ_create();
av = args_first_value(args, 'e');