From a15f8fc4a66420615d237313c6a01fcf532c52a2 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 18 Jan 2009 14:40:48 +0000 Subject: Support command sequences separated by " ; ". Also clean up command printing. --- cmd-list-keys.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'cmd-list-keys.c') 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 @@ -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) -- cgit v1.2.3