From 6ad2c5c40fb1532b2eeae9f01327752708c6a510 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 10 Feb 2013 18:26:22 +0000 Subject: [PATCH] Show alias in lscm output. --- cmd-list-commands.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cmd-list-commands.c b/cmd-list-commands.c index 68e0e80d..2acdfc50 100644 --- a/cmd-list-commands.c +++ b/cmd-list-commands.c @@ -42,8 +42,15 @@ cmd_list_commands_exec(unused struct cmd *self, struct cmd_ctx *ctx) { const struct cmd_entry **entryp; - for (entryp = cmd_table; *entryp != NULL; entryp++) - ctx->print(ctx, "%s %s", (*entryp)->name, (*entryp)->usage); + for (entryp = cmd_table; *entryp != NULL; entryp++) { + if ((*entryp)->alias != NULL) { + ctx->print(ctx, "%s (%s) %s", (*entryp)->name, + (*entryp)->alias, (*entryp)->usage); + } else { + ctx->print(ctx, "%s %s", (*entryp)->name, + (*entryp)->usage); + } + } return (CMD_RETURN_NORMAL); }