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:
Timo Sirainen 2000-07-23 23:19:22 +00:00 committed by cras
commit c529fe0096
27 changed files with 186 additions and 21 deletions

View file

@ -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();

View file

@ -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;

View file

@ -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;

View file

@ -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)) {

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -153,6 +153,7 @@ static void cmd_channel_list_joined(void)
}
}
/* SYNTAX: CHANNEL LIST */
static void cmd_channel_list(void)
{
GString *str;
@ -190,6 +191,8 @@ static void cmd_channel(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *i
command_runsub("channel", data, server, item);
}
/* SYNTAX: CHANNEL ADD [-auto | -noauto] [-bots <masks>] [-botcmd <command>]
<channel> <ircnet> [<password>] */
static void cmd_channel_add(const char *data)
{
GHashTable *optlist;
@ -227,6 +230,7 @@ static void cmd_channel_add(const char *data)
cmd_params_free(free_arg);
}
/* SYNTAX: CHANNEL REMOVE <channel> <ircnet> */
static void cmd_channel_remove(const char *data)
{
SETUP_CHANNEL_REC *rec;

View file

@ -148,14 +148,12 @@ static void cmd_ignore_show(void)
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_IGNORE_FOOTER);
}
/* SYNTAX: IGNORE [-regexp | -word] [-pattern <pattern>] [-except] [-replies]
[-channels <channel>] [-time <secs>] <mask> <levels>
IGNORE [-regexp | -word] [-pattern <pattern>] [-except] [-replies]
[-time <secs>] <channels> <levels> */
static void cmd_ignore(const char *data)
{
/* /IGNORE [-regexp | -word] [-pattern <pattern>] [-except]
[-replies] [-channels <channel>] [-time <secs>] <mask> <levels>
OR
/IGNORE [-regexp | -word] [-pattern <pattern>] [-except] [-replies]
[-time <secs>] <channels> <levels> */
GHashTable *optlist;
IGNORE_REC *rec;
char *patternarg, *chanarg, *mask, *levels, *key, *timestr;
@ -247,6 +245,7 @@ static void fe_unignore(IGNORE_REC *rec)
ignore_update_rec(rec);
}
/* SYNTAX: UNIGNORE <id>|<mask> */
static void cmd_unignore(const char *data)
{
IGNORE_REC *rec;

View file

@ -38,6 +38,7 @@
#include "windows.h"
#include "window-items.h"
/* SYNTAX: UNQUERY [<nick>] */
static void cmd_unquery(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
{
QUERY_REC *query;
@ -59,7 +60,8 @@ static void cmd_unquery(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *it
query_destroy(query);
}
static void cmd_query(gchar *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
/* SYNTAX: QUERY <nick> */
static void cmd_query(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
{
WINDOW_REC *window;
QUERY_REC *query;
@ -178,6 +180,7 @@ static void cmd_msg(gchar *data, IRC_SERVER_REC *server, WI_ITEM_REC *item)
cmd_params_free(free_arg);
}
/* SYNTAX: ME <message> */
static void cmd_me(gchar *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
{
g_return_if_fail(data != NULL);
@ -195,6 +198,7 @@ static void cmd_me(gchar *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
irc_send_cmdv(server, "PRIVMSG %s :\001ACTION %s\001", item->name, data);
}
/* SYNTAX: ACTION [<target>] <message> */
static void cmd_action(const char *data, IRC_SERVER_REC *server)
{
char *target, *text;
@ -216,7 +220,8 @@ static void cmd_action(const char *data, IRC_SERVER_REC *server)
cmd_params_free(free_arg);
}
static void cmd_notice(gchar *data, IRC_SERVER_REC *server)
/* SYNTAX: NOTICE [<target>] <message> */
static void cmd_notice(const char *data, IRC_SERVER_REC *server)
{
char *target, *msg;
void *free_arg;
@ -307,6 +312,7 @@ static void cmd_wall(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
cmd_params_free(free_arg);
}
/* SYNTAX: BAN [<channel>] [<nicks>] */
static void cmd_ban(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
{
CHANNEL_REC *cur_channel, *channel;
@ -336,6 +342,7 @@ static void cmd_ban(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
g_string_sprintf(str, "%s e", data);
signal_emit("command mode", 3, str->str, server, cur_channel);
g_string_free(str, TRUE);
signal_stop();
return;
}
}
@ -369,6 +376,7 @@ static void cmd_ban(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
signal_stop();
}
/* SYNTAX: INVITELIST [<channel>] */
static void cmd_invitelist(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
{
CHANNEL_REC *channel, *cur_channel;
@ -412,6 +420,7 @@ static void cmd_nick(const char *data, IRC_SERVER_REC *server)
signal_stop();
}
/* SYNTAX: VER [<target>] */
static void cmd_ver(gchar *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
{
char *str;
@ -428,6 +437,7 @@ static void cmd_ver(gchar *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
g_free(str);
}
/* SYNTAX: TS */
static void cmd_ts(const char *data)
{
GSList *tmp;

View file

@ -78,6 +78,9 @@ static void print_reconnects(void)
}
}
/* SYNTAX: SERVER ADD [-auto | -noauto] [-ircnet <ircnet>] [-host <hostname>]
[-cmdspeed <ms>] [-cmdmax <count>] [-port <port>]
<address> [<port> [<password>]] */
static void cmd_server_add(const char *data)
{
GHashTable *optlist;
@ -132,6 +135,7 @@ static void cmd_server_add(const char *data)
cmd_params_free(free_arg);
}
/* SYNTAX: SERVER REMOVE <address> [<port>] */
static void cmd_server_remove(const char *data)
{
SETUP_SERVER_REC *rec;
@ -142,7 +146,7 @@ static void cmd_server_remove(const char *data)
if (!cmd_get_params(data, &free_arg, 2, &addr, &portstr))
return;
if (*addr == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
port = *portstr == '\0' ? 6667 : atoi(portstr);
port = *portstr == '\0' ? -1 : atoi(portstr);
rec = server_setup_find(addr, port);
if (rec == NULL)
@ -155,6 +159,7 @@ static void cmd_server_remove(const char *data)
cmd_params_free(free_arg);
}
/* SYNTAX: SERVER LIST */
static void cmd_server_list(const char *data)
{
GString *str;

View file

@ -72,6 +72,10 @@ static void cmd_ircnet_list(void)
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_IRCNET_FOOTER);
}
/* SYNTAX: IRCNET ADD [-kicks <count>] [-msgs <count>] [-modes <count>]
[-whois <count>] [-cmdspeed <ms>] [-cmdmax <count>]
[-nick <nick>] [-user <user>] [-realname <name>]
[-host <host>] [-autosendcmd <cmd>] <name> */
static void cmd_ircnet_add(const char *data)
{
GHashTable *optlist;
@ -135,6 +139,7 @@ static void cmd_ircnet_add(const char *data)
cmd_params_free(free_arg);
}
/* SYNTAX: IRCNET REMOVE <ircnet> */
static void cmd_ircnet_remove(const char *data)
{
IRCNET_REC *rec;

View file

@ -239,6 +239,7 @@ static void split_print(const char *nick, NETSPLIT_REC *rec)
rec->server->server, rec->server->destserver);
}
/* SYNTAX: NETSPLIT */
static void cmd_netsplit(const char *data, IRC_SERVER_REC *server)
{
if (server == NULL || !server->connected)