mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 04:43:34 +02:00
Moved is_base_command() from command completion to command_have_sub()
in core/commands. /HELP <command with subcommands> works now right. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@437 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
abb46a0313
commit
8bea491a57
4 changed files with 48 additions and 26 deletions
|
|
@ -52,6 +52,25 @@ COMMAND_REC *command_find(const char *cmd)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int command_have_sub(const char *command)
|
||||
{
|
||||
GSList *tmp;
|
||||
int len;
|
||||
|
||||
g_return_val_if_fail(command != NULL, FALSE);
|
||||
|
||||
/* find "command "s */
|
||||
len = strlen(command);
|
||||
for (tmp = commands; tmp != NULL; tmp = tmp->next) {
|
||||
COMMAND_REC *rec = tmp->data;
|
||||
|
||||
if (g_strncasecmp(rec->cmd, command, len) == 0 && rec->cmd[len] == ' ')
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void command_bind_to(int pos, const char *cmd, const char *category, SIGNAL_FUNC func)
|
||||
{
|
||||
COMMAND_REC *rec;
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ void command_unbind(const char *cmd, SIGNAL_FUNC func);
|
|||
void command_runsub(const char *cmd, const char *data, void *server, void *item);
|
||||
|
||||
COMMAND_REC *command_find(const char *cmd);
|
||||
int command_have_sub(const char *command);
|
||||
|
||||
/* Specify options that command can accept. `options' contains list of
|
||||
options separated with space, each option can contain a special
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue