Validate command argument types (string or command list) and give more

useful error messages.
This commit is contained in:
nicm
2021-08-25 08:51:55 +00:00
parent c6d6af4903
commit 03d173cbd8
12 changed files with 230 additions and 44 deletions

View File

@ -634,8 +634,10 @@ key_bindings_init(void)
for (i = 0; i < nitems(defaults); i++) {
pr = cmd_parse_from_string(defaults[i], NULL);
if (pr->status != CMD_PARSE_SUCCESS)
if (pr->status != CMD_PARSE_SUCCESS) {
log_debug("%s", pr->error);
fatalx("bad default key: %s", defaults[i]);
}
cmdq_append(NULL, cmdq_get_command(pr->cmdlist, NULL));
cmd_list_free(pr->cmdlist);
}