fixed help
This commit is contained in:
parent
5e9e5ce409
commit
fed99d9b18
@ -687,13 +687,13 @@ struct command commands[];
|
|||||||
|
|
||||||
/* {{{ client methods */
|
/* {{{ client methods */
|
||||||
void do_help (struct command *command, int arg_num, struct arg args[], struct in_ev *ev) {
|
void do_help (struct command *command, int arg_num, struct arg args[], struct in_ev *ev) {
|
||||||
assert (arg_num <= 1);
|
assert (arg_num == 1);
|
||||||
if (ev) { mprint_start (ev); }
|
if (ev) { mprint_start (ev); }
|
||||||
int total = 0;
|
int total = 0;
|
||||||
mpush_color (ev, COLOR_YELLOW);
|
mpush_color (ev, COLOR_YELLOW);
|
||||||
struct command *cmd = commands;
|
struct command *cmd = commands;
|
||||||
while (cmd->name) {
|
while (cmd->name) {
|
||||||
if (!arg_num || !strcmp (args[0].str, cmd->name)) {
|
if (!args[0].str || !strcmp (args[0].str, cmd->name)) {
|
||||||
mprintf (ev, "%s\n", cmd->desc);
|
mprintf (ev, "%s\n", cmd->desc);
|
||||||
total ++;
|
total ++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user