summaryrefslogtreecommitdiffstats
path: root/cmd-unbind-key.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2011-01-10 21:28:47 +0000
committerNicholas Marriott <nicm@openbsd.org>2011-01-10 21:28:47 +0000
commit47e18f4ceacc4c207dc0d392f51d55b2286672f2 (patch)
tree400f379ba41d55a74bed710b0a47c532ec201639 /cmd-unbind-key.c
parent17f1cd5be81eddf34139f24263a9e00d2dd372e5 (diff)
unbind-key -a is allowed no arguments.
Diffstat (limited to 'cmd-unbind-key.c')
-rw-r--r--cmd-unbind-key.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd-unbind-key.c b/cmd-unbind-key.c
index 7dab5683..8eb829d4 100644
--- a/cmd-unbind-key.c
+++ b/cmd-unbind-key.c
@@ -31,7 +31,7 @@ int cmd_unbind_key_table(struct cmd *, struct cmd_ctx *, int);
const struct cmd_entry cmd_unbind_key_entry = {
"unbind-key", "unbind",
- "acnt:", 1, 1,
+ "acnt:", 0, 1,
"[-acn] [-t key-table] key",
0,
NULL,
@@ -43,6 +43,8 @@ int
cmd_unbind_key_check(struct args *args)
{
if (args_has(args, 'a') && (args->argc != 0 || args_has(args, 't')))
+ return (-1);
+ if (!args_has(args, 'a') && args->argc != 1)
return (-1);
return (0);
}