summaryrefslogtreecommitdiffstats
path: root/cmd-list-keys.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-01-18 14:40:48 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-01-18 14:40:48 +0000
commita15f8fc4a66420615d237313c6a01fcf532c52a2 (patch)
tree751d858639e20ae413ec907f7cf3215c06e3820d /cmd-list-keys.c
parentc4d5989a4ef03db0477446ee004ef431be268286 (diff)
Support command sequences separated by " ; ". Also clean up command printing.
Diffstat (limited to 'cmd-list-keys.c')
-rw-r--r--cmd-list-keys.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/cmd-list-keys.c b/cmd-list-keys.c
index 299681b9..faa29916 100644
--- a/cmd-list-keys.c
+++ b/cmd-list-keys.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-list-keys.c,v 1.11 2009-01-06 14:10:32 nicm Exp $ */
+/* $Id: cmd-list-keys.c,v 1.12 2009-01-18 14:40:48 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -44,17 +44,15 @@ cmd_list_keys_exec(unused struct cmd *self, struct cmd_ctx *ctx)
{
struct key_binding *bd;
const char *key;
- char s[BUFSIZ];
+ char tmp[BUFSIZ];
SPLAY_FOREACH(bd, key_bindings, &key_bindings) {
if ((key = key_string_lookup_key(bd->key)) == NULL)
continue;
- if (bd->cmd->entry->print == NULL) {
- ctx->print(ctx, "%11s: %s", key, bd->cmd->entry->name);
- continue;
- }
- bd->cmd->entry->print(bd->cmd, s, sizeof s);
- ctx->print(ctx, "%11s: %s", key, s);
+
+ *tmp = '\0';
+ cmd_list_print(bd->cmdlist, tmp, sizeof tmp);
+ ctx->print(ctx, "%11s: %s", key, tmp);
}
if (ctx->cmdclient != NULL)