Fix bind-key -t.

This commit is contained in:
Nicholas Marriott 2011-01-15 20:14:41 +00:00
parent 3de1700f61
commit 1377427e70

View File

@ -45,7 +45,7 @@ int
cmd_bind_key_check(struct args *args) cmd_bind_key_check(struct args *args)
{ {
if (args_has(args, 't')) { if (args_has(args, 't')) {
if (args->argc != 1) if (args->argc != 2)
return (-1); return (-1);
} else { } else {
if (args->argc < 2) if (args->argc < 2)
@ -99,9 +99,9 @@ cmd_bind_key_table(struct cmd *self, struct cmd_ctx *ctx, int key)
return (-1); return (-1);
} }
cmd = mode_key_fromstring(mtab->cmdstr, args->argv[0]); cmd = mode_key_fromstring(mtab->cmdstr, args->argv[1]);
if (cmd == MODEKEY_NONE) { if (cmd == MODEKEY_NONE) {
ctx->error(ctx, "unknown command: %s", args->argv[0]); ctx->error(ctx, "unknown command: %s", args->argv[1]);
return (-1); return (-1);
} }