mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 04:13:32 +02:00
Added syntaxes of all commands in comments, they're going to be used to
autogenerate help files. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@529 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
3e9164df1b
commit
c529fe0096
27 changed files with 186 additions and 21 deletions
|
|
@ -234,6 +234,7 @@ static void show_help(const char *data)
|
|||
}
|
||||
}
|
||||
|
||||
/* SYNTAX: HELP [<command>] */
|
||||
static void cmd_help(const char *data)
|
||||
{
|
||||
char *cmd, *ptr;
|
||||
|
|
@ -246,6 +247,7 @@ static void cmd_help(const char *data)
|
|||
g_free(cmd);
|
||||
}
|
||||
|
||||
/* SYNTAX: ECHO [<text>] */
|
||||
static void cmd_echo(const char *data, void *server, WI_ITEM_REC *item)
|
||||
{
|
||||
g_return_if_fail(data != NULL);
|
||||
|
|
@ -253,6 +255,7 @@ static void cmd_echo(const char *data, void *server, WI_ITEM_REC *item)
|
|||
printtext(server, item == NULL ? NULL : item->name, MSGLEVEL_CRAP, "%s", data);
|
||||
}
|
||||
|
||||
/* SYNTAX: VERSION */
|
||||
static void cmd_version(char *data)
|
||||
{
|
||||
g_return_if_fail(data != NULL);
|
||||
|
|
@ -261,6 +264,7 @@ static void cmd_version(char *data)
|
|||
printtext(NULL, NULL, MSGLEVEL_CLIENTNOTICE, "Client: "PACKAGE" " IRSSI_VERSION);
|
||||
}
|
||||
|
||||
/* SYNTAX: CAT <file> */
|
||||
static void cmd_cat(const char *data)
|
||||
{
|
||||
LINEBUF_REC *buffer = NULL;
|
||||
|
|
@ -297,6 +301,7 @@ static void cmd_cat(const char *data)
|
|||
close(f);
|
||||
}
|
||||
|
||||
/* SYNTAX: BEEP */
|
||||
static void cmd_beep(void)
|
||||
{
|
||||
printbeep();
|
||||
|
|
|
|||
|
|
@ -41,10 +41,10 @@ static int autolog_level;
|
|||
static int autoremove_tag;
|
||||
static const char *autolog_path;
|
||||
|
||||
/* SYNTAX: LOG OPEN [-noopen] [-autoopen] [-targets <targets>] [-window]
|
||||
[-rotate hourly|daily|weekly|monthly] <fname> [<levels>] */
|
||||
static void cmd_log_open(const char *data)
|
||||
{
|
||||
/* /LOG OPEN [-noopen] [-autoopen] [-targets <targets>] [-window]
|
||||
[-rotate hour|day|week|month] <fname> [<levels>] */
|
||||
GHashTable *optlist;
|
||||
char *targetarg, *rotatearg, *fname, *levels;
|
||||
void *free_arg;
|
||||
|
|
@ -109,6 +109,7 @@ static LOG_REC *log_find_from_data(const char *data)
|
|||
return tmp == NULL ? NULL : tmp->data;
|
||||
}
|
||||
|
||||
/* SYNTAX: LOG CLOSE <id>|<file> */
|
||||
static void cmd_log_close(const char *data)
|
||||
{
|
||||
LOG_REC *log;
|
||||
|
|
@ -122,6 +123,7 @@ static void cmd_log_close(const char *data)
|
|||
}
|
||||
}
|
||||
|
||||
/* SYNTAX: LOG START <id>|<file> */
|
||||
static void cmd_log_start(const char *data)
|
||||
{
|
||||
LOG_REC *log;
|
||||
|
|
@ -133,6 +135,7 @@ static void cmd_log_start(const char *data)
|
|||
}
|
||||
}
|
||||
|
||||
/* SYNTAX: LOG STOP <id>|<file> */
|
||||
static void cmd_log_stop(const char *data)
|
||||
{
|
||||
LOG_REC *log;
|
||||
|
|
@ -146,6 +149,7 @@ static void cmd_log_stop(const char *data)
|
|||
}
|
||||
}
|
||||
|
||||
/* SYNTAX: LOG LIST */
|
||||
static void cmd_log_list(void)
|
||||
{
|
||||
GSList *tmp;
|
||||
|
|
@ -196,9 +200,9 @@ static LOG_REC *log_find_item(const char *item)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* SYNTAX: WINDOW LOG on|off|toggle [<filename>] */
|
||||
static void cmd_window_log(const char *data)
|
||||
{
|
||||
/* /WINDOW LOG ON|OFF|TOGGLE [<filename>] */
|
||||
LOG_REC *log;
|
||||
char *set, *fname, window[MAX_INT_STRLEN];
|
||||
void *free_arg;
|
||||
|
|
@ -247,6 +251,7 @@ static void cmd_window_log(const char *data)
|
|||
}
|
||||
|
||||
/* Create log file entry to window, but don't start logging */
|
||||
/* SYNTAX: WINDOW LOGFILE <file> */
|
||||
static void cmd_window_logfile(const char *data)
|
||||
{
|
||||
LOG_REC *log;
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ static void sig_module_unloaded(MODULE_REC *rec)
|
|||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_MODULE_UNLOADED, rec->name);
|
||||
}
|
||||
|
||||
/* SYNTAX: LOAD <module> */
|
||||
static void cmd_load(const char *data)
|
||||
{
|
||||
g_return_if_fail(data != NULL);
|
||||
|
|
@ -58,6 +59,7 @@ static void cmd_load(const char *data)
|
|||
module_load(data);
|
||||
}
|
||||
|
||||
/* SYNTAX: UNLOAD <module> */
|
||||
static void cmd_unload(const char *data)
|
||||
{
|
||||
MODULE_REC *rec;
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ static void set_boolean(const char *key, const char *value)
|
|||
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_NOT_TOGGLE);
|
||||
}
|
||||
|
||||
/* SYNTAX: SET [-clear] [<key> [<value>] */
|
||||
static void cmd_set(char *data)
|
||||
{
|
||||
GHashTable *optlist;
|
||||
|
|
@ -123,6 +124,7 @@ static void cmd_set(char *data)
|
|||
cmd_params_free(free_arg);
|
||||
}
|
||||
|
||||
/* SYNTAX: TOGGLE <key> [on|off|toggle] */
|
||||
static void cmd_toggle(const char *data)
|
||||
{
|
||||
char *key, *value;
|
||||
|
|
@ -198,6 +200,7 @@ static void alias_remove(const char *alias)
|
|||
}
|
||||
}
|
||||
|
||||
/* SYNTAX: ALIAS [[-]<alias> [<command>]] */
|
||||
static void cmd_alias(const char *data)
|
||||
{
|
||||
char *alias, *value;
|
||||
|
|
@ -219,6 +222,7 @@ static void cmd_alias(const char *data)
|
|||
cmd_params_free(free_arg);
|
||||
}
|
||||
|
||||
/* SYNTAX: UNALIAS <alias> */
|
||||
static void cmd_unalias(const char *data)
|
||||
{
|
||||
g_return_if_fail(data != NULL);
|
||||
|
|
@ -227,6 +231,7 @@ static void cmd_unalias(const char *data)
|
|||
alias_remove(data);
|
||||
}
|
||||
|
||||
/* SYNTAX: RELOAD [<file>] */
|
||||
static void cmd_reload(const char *data)
|
||||
{
|
||||
char *fname;
|
||||
|
|
@ -240,6 +245,7 @@ static void cmd_reload(const char *data)
|
|||
g_free(fname);
|
||||
}
|
||||
|
||||
/* SYNTAX: SAVE [<file>] */
|
||||
static void cmd_save(const char *data)
|
||||
{
|
||||
if (settings_save(*data != '\0' ? data : NULL)) {
|
||||
|
|
|
|||
|
|
@ -356,9 +356,11 @@ static void cmd_hilight_show(void)
|
|||
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_HILIGHT_FOOTER);
|
||||
}
|
||||
|
||||
/* SYNTAX: HILIGHT [-nick | -nonick] [-mask | -regexp | -word]
|
||||
[-color <color>] [-level <level>]
|
||||
[-channels <channels>] <text> */
|
||||
static void cmd_hilight(const char *data)
|
||||
{
|
||||
/* /HILIGHT [-nick | -nonick] [-mask | -regexp | -word] [-color <color>] [-level <level>] [-channels <channels>] <text> */
|
||||
GHashTable *optlist;
|
||||
HILIGHT_REC *rec;
|
||||
char *colorarg, *levelarg, *chanarg, *text;
|
||||
|
|
@ -419,6 +421,7 @@ static void cmd_hilight(const char *data)
|
|||
cmd_params_free(free_arg);
|
||||
}
|
||||
|
||||
/* SYNTAX: DEHILIGHT <id>|<mask> */
|
||||
static void cmd_dehilight(const char *data)
|
||||
{
|
||||
HILIGHT_REC *rec;
|
||||
|
|
|
|||
|
|
@ -300,6 +300,7 @@ static void cmd_show_keys(const char *searchkey, int full)
|
|||
}
|
||||
}
|
||||
|
||||
/* SYNTAX: BIND [<key> [<command> [<data>]]] */
|
||||
static void cmd_bind(const char *data)
|
||||
{
|
||||
GHashTable *optlist;
|
||||
|
|
|
|||
|
|
@ -346,6 +346,7 @@ static void theme_show(THEME_SEARCH_REC *rec, const char *key, const char *value
|
|||
}
|
||||
}
|
||||
|
||||
/* SYNTAX: FORMAT [-delete | -reset] [<module>] [<key> [<value>]] */
|
||||
static void cmd_format(const char *data)
|
||||
{
|
||||
GHashTable *optlist;
|
||||
|
|
@ -354,7 +355,6 @@ static void cmd_format(const char *data)
|
|||
void *free_arg;
|
||||
int reset;
|
||||
|
||||
/* /FORMAT [<module>] [<key> [<value>]] */
|
||||
if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_GETREST | PARAM_FLAG_OPTIONS,
|
||||
"format", &optlist, &module, &key, &value))
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ static void cmd_window(const char *data, void *server, WI_ITEM_REC *item)
|
|||
command_runsub("window", data, server, item);
|
||||
}
|
||||
|
||||
/* SYNTAX: WINDOW NEW [hide] */
|
||||
static void cmd_window_new(const char *data, void *server, WI_ITEM_REC *item)
|
||||
{
|
||||
WINDOW_REC *window;
|
||||
|
|
@ -50,6 +51,7 @@ static void cmd_window_new(const char *data, void *server, WI_ITEM_REC *item)
|
|||
window_change_server(window, server);
|
||||
}
|
||||
|
||||
/* SYNTAX: WINDOW CLOSE */
|
||||
static void cmd_window_close(const char *data)
|
||||
{
|
||||
/* destroy window unless it's the last one */
|
||||
|
|
@ -57,6 +59,7 @@ static void cmd_window_close(const char *data)
|
|||
window_destroy(active_win);
|
||||
}
|
||||
|
||||
/* SYNTAX: WINDOW REFNUM <number> */
|
||||
static void cmd_window_refnum(const char *data)
|
||||
{
|
||||
WINDOW_REC *window;
|
||||
|
|
@ -101,6 +104,7 @@ static WINDOW_REC *window_highest_activity(WINDOW_REC *window)
|
|||
return max_win;
|
||||
}
|
||||
|
||||
/* SYNTAX: WINDOW GOTO active|<number>|<name> */
|
||||
static void cmd_window_goto(const char *data)
|
||||
{
|
||||
WINDOW_REC *window;
|
||||
|
|
@ -121,6 +125,7 @@ static void cmd_window_goto(const char *data)
|
|||
window_set_active(window);
|
||||
}
|
||||
|
||||
/* SYNTAX: WINDOW NEXT */
|
||||
static void cmd_window_next(void)
|
||||
{
|
||||
int num;
|
||||
|
|
@ -131,12 +136,14 @@ static void cmd_window_next(void)
|
|||
window_set_active(window_find_refnum(num));
|
||||
}
|
||||
|
||||
/* SYNTAX: WINDOW LAST */
|
||||
static void cmd_window_last(void)
|
||||
{
|
||||
if (windows->next != NULL)
|
||||
window_set_active(windows->next->data);
|
||||
}
|
||||
|
||||
/* SYNTAX: WINDOW PREV */
|
||||
static void cmd_window_prev(void)
|
||||
{
|
||||
int num;
|
||||
|
|
@ -147,6 +154,7 @@ static void cmd_window_prev(void)
|
|||
window_set_active(window_find_refnum(num));
|
||||
}
|
||||
|
||||
/* SYNTAX: WINDOW LEVEL [<level>] */
|
||||
static void cmd_window_level(const char *data)
|
||||
{
|
||||
char *level;
|
||||
|
|
@ -160,6 +168,7 @@ static void cmd_window_level(const char *data)
|
|||
g_free(level);
|
||||
}
|
||||
|
||||
/* SYNTAX: WINDOW SERVER <tag> */
|
||||
static void cmd_window_server(const char *data)
|
||||
{
|
||||
SERVER_REC *server;
|
||||
|
|
@ -176,16 +185,24 @@ static void cmd_window_server(const char *data)
|
|||
}
|
||||
}
|
||||
|
||||
static void cmd_window_item(const char *data, void *server, WI_ITEM_REC *item)
|
||||
{
|
||||
command_runsub("window item", data, server, item);
|
||||
}
|
||||
|
||||
/* SYNTAX: WINDOW ITEM PREV */
|
||||
static void cmd_window_item_prev(void)
|
||||
{
|
||||
window_item_prev(active_win);
|
||||
}
|
||||
|
||||
/* SYNTAX: WINDOW ITEM NEXT */
|
||||
static void cmd_window_item_next(void)
|
||||
{
|
||||
window_item_next(active_win);
|
||||
}
|
||||
|
||||
/* SYNTAX: WINDOW NUMBER <number> */
|
||||
static void cmd_window_number(const char *data)
|
||||
{
|
||||
int num;
|
||||
|
|
@ -197,6 +214,7 @@ static void cmd_window_number(const char *data)
|
|||
window_set_refnum(active_win, num);
|
||||
}
|
||||
|
||||
/* SYNTAX: WINDOW NAME <name> */
|
||||
static void cmd_window_name(const char *data)
|
||||
{
|
||||
window_set_name(active_win, data);
|
||||
|
|
@ -267,6 +285,7 @@ static void cmd_window_move_right(void)
|
|||
windows_move_right(active_win);
|
||||
}
|
||||
|
||||
/* SYNTAX: WINDOW MOVE <number>|left|right */
|
||||
static void cmd_window_move(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
|
||||
{
|
||||
int new_refnum, refnum;
|
||||
|
|
@ -313,6 +332,7 @@ static GSList *windows_get_sorted(void)
|
|||
return list;
|
||||
}
|
||||
|
||||
/* SYNTAX: WINDOW LIST */
|
||||
static void cmd_window_list(void)
|
||||
{
|
||||
GSList *tmp, *sorted;
|
||||
|
|
@ -348,6 +368,7 @@ void window_commands_init(void)
|
|||
command_bind("window next", NULL, (SIGNAL_FUNC) cmd_window_next);
|
||||
command_bind("window last", NULL, (SIGNAL_FUNC) cmd_window_last);
|
||||
command_bind("window level", NULL, (SIGNAL_FUNC) cmd_window_level);
|
||||
command_bind("window item", NULL, (SIGNAL_FUNC) cmd_window_item);
|
||||
command_bind("window item prev", NULL, (SIGNAL_FUNC) cmd_window_item_prev);
|
||||
command_bind("window item next", NULL, (SIGNAL_FUNC) cmd_window_item_next);
|
||||
command_bind("window number", NULL, (SIGNAL_FUNC) cmd_window_number);
|
||||
|
|
@ -371,6 +392,7 @@ void window_commands_deinit(void)
|
|||
command_unbind("window next", (SIGNAL_FUNC) cmd_window_next);
|
||||
command_unbind("window last", (SIGNAL_FUNC) cmd_window_last);
|
||||
command_unbind("window level", (SIGNAL_FUNC) cmd_window_level);
|
||||
command_unbind("window item", (SIGNAL_FUNC) cmd_window_item);
|
||||
command_unbind("window item prev", (SIGNAL_FUNC) cmd_window_item_prev);
|
||||
command_unbind("window item next", (SIGNAL_FUNC) cmd_window_item_next);
|
||||
command_unbind("window number", (SIGNAL_FUNC) cmd_window_number);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue