mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 12:23:37 +02:00
WJOIN -> /JOIN -window
WQUERY -> /QUERY -window. Added support for /QUERY -<server tag>. Added aliases for WJOIN and WQUERY to default config file. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@590 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
81af47808b
commit
308e84bbc4
9 changed files with 150 additions and 29 deletions
|
|
@ -233,6 +233,27 @@ static GSList *optlist_find(GSList *optlist, const char *option)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int command_have_option(const char *cmd, const char *option)
|
||||
{
|
||||
COMMAND_REC *rec;
|
||||
char **tmp;
|
||||
|
||||
g_return_val_if_fail(cmd != NULL, FALSE);
|
||||
g_return_val_if_fail(option != NULL, FALSE);
|
||||
|
||||
rec = command_find(cmd);
|
||||
g_return_val_if_fail(rec != NULL, FALSE);
|
||||
|
||||
for (tmp = rec->options; *tmp != NULL; tmp++) {
|
||||
char *name = iscmdtype(**tmp) ? (*tmp)+1 : *tmp;
|
||||
|
||||
if (g_strcasecmp(name, option) == 0)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void command_set_options(const char *cmd, const char *options)
|
||||
{
|
||||
COMMAND_REC *rec;
|
||||
|
|
@ -276,7 +297,6 @@ void command_set_options(const char *cmd, const char *options)
|
|||
g_strfreev(optlist);
|
||||
|
||||
/* linked list -> string[] */
|
||||
g_free(rec->options);
|
||||
str = gslist_to_string(list, " ");
|
||||
rec->options = g_strsplit(str, " ", -1);
|
||||
g_free(str);
|
||||
|
|
|
|||
|
|
@ -82,6 +82,9 @@ int command_have_sub(const char *command);
|
|||
((c) == '-' || (c) == '+' || (c) == '@')
|
||||
void command_set_options(const char *cmd, const char *options);
|
||||
|
||||
/* Returns TRUE if command has specified option. */
|
||||
int command_have_option(const char *cmd, const char *option);
|
||||
|
||||
/* count can have these flags: */
|
||||
#define PARAM_WITHOUT_FLAGS(a) ((a) & 0x00ffffff)
|
||||
/* don't check for quotes - "arg1 arg2" is NOT treated as one argument */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue