diff options
author | 2013-03-21 16:12:50 +0000 | |
---|---|---|
committer | 2013-03-21 16:12:50 +0000 | |
commit | 5c36332b46c7642559ec4828fac4ea03571739e9 (patch) | |
tree | 41a2abe43545cea9405ff2380ef8fe7cbabda430 | |
parent | Rework reflow code so it does not do so much allocation which should be (diff) | |
download | wireguard-openbsd-5c36332b46c7642559ec4828fac4ea03571739e9.tar.xz wireguard-openbsd-5c36332b46c7642559ec4828fac4ea03571739e9.zip |
Show alias in lscm output.
-rw-r--r-- | usr.bin/tmux/cmd-list-commands.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-list-commands.c b/usr.bin/tmux/cmd-list-commands.c index c7e9ee27fae..94210151fee 100644 --- a/usr.bin/tmux/cmd-list-commands.c +++ b/usr.bin/tmux/cmd-list-commands.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-list-commands.c,v 1.7 2012/07/11 07:10:15 nicm Exp $ */ +/* $OpenBSD: cmd-list-commands.c,v 1.8 2013/03/21 16:12:50 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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); } |