=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd.c,v retrieving revision 1.170 retrieving revision 1.171 diff -c -r1.170 -r1.171 *** src/usr.bin/tmux/cmd.c 2021/08/21 18:39:07 1.170 --- src/usr.bin/tmux/cmd.c 2021/08/25 08:51:55 1.171 *************** *** 1,4 **** ! /* $OpenBSD: cmd.c,v 1.170 2021/08/21 18:39:07 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd.c,v 1.171 2021/08/25 08:51:55 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 502,507 **** --- 502,508 ---- const struct cmd_entry *entry; struct cmd *cmd; struct args *args; + char *error; if (count == 0 || values[0].type != ARGS_STRING) { xasprintf(cause, "no command"); *************** *** 511,519 **** if (entry == NULL) return (NULL); ! args = args_parse(&entry->args, values, count); ! if (args == NULL) { xasprintf(cause, "usage: %s %s", entry->name, entry->usage); return (NULL); } --- 512,525 ---- if (entry == NULL) return (NULL); ! args = args_parse(&entry->args, values, count, &error); ! if (args == NULL && error == NULL) { xasprintf(cause, "usage: %s %s", entry->name, entry->usage); + return (NULL); + } + if (args == NULL) { + xasprintf(cause, "command %s: %s", entry->name, error); + free(error); return (NULL); }