version 1.9, 2013/03/22 10:31:22 |
version 1.10, 2013/03/24 09:54:10 |
|
|
* List all commands with usages. |
* List all commands with usages. |
*/ |
*/ |
|
|
enum cmd_retval cmd_list_commands_exec(struct cmd *, struct cmd_ctx *); |
enum cmd_retval cmd_list_commands_exec(struct cmd *, struct cmd_q *); |
|
|
const struct cmd_entry cmd_list_commands_entry = { |
const struct cmd_entry cmd_list_commands_entry = { |
"list-commands", "lscm", |
"list-commands", "lscm", |
|
|
}; |
}; |
|
|
enum cmd_retval |
enum cmd_retval |
cmd_list_commands_exec(unused struct cmd *self, struct cmd_ctx *ctx) |
cmd_list_commands_exec(unused struct cmd *self, struct cmd_q *cmdq) |
{ |
{ |
const struct cmd_entry **entryp; |
const struct cmd_entry **entryp; |
|
|
for (entryp = cmd_table; *entryp != NULL; entryp++) { |
for (entryp = cmd_table; *entryp != NULL; entryp++) { |
if ((*entryp)->alias != NULL) { |
if ((*entryp)->alias != NULL) { |
ctx->print(ctx, "%s (%s) %s", (*entryp)->name, |
cmdq_print(cmdq, "%s (%s) %s", (*entryp)->name, |
(*entryp)->alias, (*entryp)->usage); |
(*entryp)->alias, (*entryp)->usage); |
} else { |
} else { |
ctx->print(ctx, "%s %s", (*entryp)->name, |
cmdq_print(cmdq, "%s %s", (*entryp)->name, |
(*entryp)->usage); |
(*entryp)->usage); |
} |
} |
} |
} |