1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00

Removed old command help

This commit is contained in:
James Booth 2015-07-26 02:05:53 +01:00
parent 36ebf0fc17
commit 34537e2fb1
6 changed files with 414 additions and 426 deletions

View File

@ -116,7 +116,7 @@ static struct cmd_t command_defs[] =
// NEW STYLE // NEW STYLE
{ "/help", { "/help",
cmd_help, parse_args, 0, 1, NULL, cmd_help, parse_args, 0, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/help [<area>|<command>]", "/help [<area>|<command>]",
NULL NULL
@ -135,7 +135,7 @@ static struct cmd_t command_defs[] =
{ "/about", { "/about",
cmd_about, parse_args, 0, 0, NULL, cmd_about, parse_args, 0, 0, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/about", "/about",
NULL NULL
@ -149,7 +149,7 @@ static struct cmd_t command_defs[] =
{ "/connect", { "/connect",
cmd_connect, parse_args, 0, 5, NULL, cmd_connect, parse_args, 0, 5, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/connect [<account>]", "/connect [<account>]",
"/connect <account> [server <server>] [port <port>]", "/connect <account> [server <server>] [port <port>]",
@ -174,7 +174,7 @@ static struct cmd_t command_defs[] =
{ "/disconnect", { "/disconnect",
cmd_disconnect, parse_args, 0, 0, NULL, cmd_disconnect, parse_args, 0, 0, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/disconnect", "/disconnect",
NULL NULL
@ -188,7 +188,7 @@ static struct cmd_t command_defs[] =
{ "/msg", { "/msg",
cmd_msg, parse_args_with_freetext, 1, 2, NULL, cmd_msg, parse_args_with_freetext, 1, 2, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/msg <contact> [<message>]", "/msg <contact> [<message>]",
"/msg <nick> [<message>]", "/msg <nick> [<message>]",
@ -213,7 +213,7 @@ static struct cmd_t command_defs[] =
{ "/roster", { "/roster",
cmd_roster, parse_args_with_freetext, 0, 3, NULL, cmd_roster, parse_args_with_freetext, 0, 3, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/roster", "/roster",
"/roster online", "/roster online",
@ -264,7 +264,7 @@ static struct cmd_t command_defs[] =
{ "/group", { "/group",
cmd_group, parse_args_with_freetext, 0, 3, NULL, cmd_group, parse_args_with_freetext, 0, 3, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/group", "/group",
"/group show <group>", "/group show <group>",
@ -289,7 +289,7 @@ static struct cmd_t command_defs[] =
{ "/info", { "/info",
cmd_info, parse_args, 0, 1, NULL, cmd_info, parse_args, 0, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/info", "/info",
"/info <contact>|<nick>", "/info <contact>|<nick>",
@ -310,7 +310,7 @@ static struct cmd_t command_defs[] =
{ "/caps", { "/caps",
cmd_caps, parse_args, 0, 1, NULL, cmd_caps, parse_args, 0, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/caps", "/caps",
"/caps <fulljid>|<nick>", "/caps <fulljid>|<nick>",
@ -331,7 +331,7 @@ static struct cmd_t command_defs[] =
{ "/software", { "/software",
cmd_software, parse_args, 0, 1, NULL, cmd_software, parse_args, 0, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/software", "/software",
"/software <fulljid>|<nick>", "/software <fulljid>|<nick>",
@ -353,7 +353,7 @@ static struct cmd_t command_defs[] =
{ "/status", { "/status",
cmd_status, parse_args, 0, 1, NULL, cmd_status, parse_args, 0, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/status", "/status",
"/status <contact>|<nick>", "/status <contact>|<nick>",
@ -373,7 +373,7 @@ static struct cmd_t command_defs[] =
{ "/resource", { "/resource",
cmd_resource, parse_args, 1, 2, &cons_resource_setting, cmd_resource, parse_args, 1, 2, &cons_resource_setting,
{ NULL, NULL, { NULL }, {
{ {
"/resource set <resource>", "/resource set <resource>",
"/resource off", "/resource off",
@ -394,7 +394,7 @@ static struct cmd_t command_defs[] =
{ "/join", { "/join",
cmd_join, parse_args, 0, 5, NULL, cmd_join, parse_args, 0, 5, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/join", "/join",
"/join <room> [nick <nick>] [password <password>]", "/join <room> [nick <nick>] [password <password>]",
@ -421,7 +421,7 @@ static struct cmd_t command_defs[] =
{ "/leave", { "/leave",
cmd_leave, parse_args, 0, 0, NULL, cmd_leave, parse_args, 0, 0, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/leave", "/leave",
NULL NULL
@ -435,7 +435,7 @@ static struct cmd_t command_defs[] =
{ "/invite", { "/invite",
cmd_invite, parse_args_with_freetext, 1, 2, NULL, cmd_invite, parse_args_with_freetext, 1, 2, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/invite <contact> [<message>]", "/invite <contact> [<message>]",
NULL NULL
@ -451,7 +451,7 @@ static struct cmd_t command_defs[] =
{ "/invites", { "/invites",
cmd_invites, parse_args_with_freetext, 0, 0, NULL, cmd_invites, parse_args_with_freetext, 0, 0, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/invites", "/invites",
NULL NULL
@ -465,7 +465,7 @@ static struct cmd_t command_defs[] =
{ "/decline", { "/decline",
cmd_decline, parse_args_with_freetext, 1, 1, NULL, cmd_decline, parse_args_with_freetext, 1, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/decline <room>", "/decline <room>",
NULL NULL
@ -480,7 +480,7 @@ static struct cmd_t command_defs[] =
{ "/room", { "/room",
cmd_room, parse_args, 1, 1, NULL, cmd_room, parse_args, 1, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/room accept|destroy|config", "/room accept|destroy|config",
NULL NULL
@ -497,7 +497,7 @@ static struct cmd_t command_defs[] =
{ "/kick", { "/kick",
cmd_kick, parse_args_with_freetext, 1, 2, NULL, cmd_kick, parse_args_with_freetext, 1, 2, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/kick <nick> [<reason>]", "/kick <nick> [<reason>]",
NULL NULL
@ -513,7 +513,7 @@ static struct cmd_t command_defs[] =
{ "/ban", { "/ban",
cmd_ban, parse_args_with_freetext, 1, 2, NULL, cmd_ban, parse_args_with_freetext, 1, 2, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/ban <jid> [<reason>]", "/ban <jid> [<reason>]",
NULL NULL
@ -529,7 +529,7 @@ static struct cmd_t command_defs[] =
{ "/subject", { "/subject",
cmd_subject, parse_args_with_freetext, 0, 2, NULL, cmd_subject, parse_args_with_freetext, 0, 2, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/subject set <subject>", "/subject set <subject>",
"/subject clear", "/subject clear",
@ -546,7 +546,7 @@ static struct cmd_t command_defs[] =
{ "/affiliation", { "/affiliation",
cmd_affiliation, parse_args_with_freetext, 1, 4, NULL, cmd_affiliation, parse_args_with_freetext, 1, 4, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/affiliation set <affiliation> <jid> [<reason>]", "/affiliation set <affiliation> <jid> [<reason>]",
"/list [<affiliation>]", "/list [<affiliation>]",
@ -564,7 +564,7 @@ static struct cmd_t command_defs[] =
{ "/role", { "/role",
cmd_role, parse_args_with_freetext, 1, 4, NULL, cmd_role, parse_args_with_freetext, 1, 4, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/role set <role> <nick> [<reason>]", "/role set <role> <nick> [<reason>]",
"/list [<role>]", "/list [<role>]",
@ -582,7 +582,7 @@ static struct cmd_t command_defs[] =
{ "/occupants", { "/occupants",
cmd_occupants, parse_args, 1, 3, cons_occupants_setting, cmd_occupants, parse_args, 1, 3, cons_occupants_setting,
{ NULL, NULL, { NULL }, {
{ {
"/occupants show|hide [jid]", "/occupants show|hide [jid]",
"/occupants default show|hide [jid]", "/occupants default show|hide [jid]",
@ -605,7 +605,7 @@ static struct cmd_t command_defs[] =
{ "/form", { "/form",
cmd_form, parse_args, 1, 2, NULL, cmd_form, parse_args, 1, 2, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/form show", "/form show",
"/form submit", "/form submit",
@ -626,7 +626,7 @@ static struct cmd_t command_defs[] =
{ "/rooms", { "/rooms",
cmd_rooms, parse_args, 0, 1, NULL, cmd_rooms, parse_args, 0, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/rooms [<service>]", "/rooms [<service>]",
NULL NULL
@ -643,7 +643,7 @@ static struct cmd_t command_defs[] =
{ "/bookmark", { "/bookmark",
cmd_bookmark, parse_args, 0, 8, NULL, cmd_bookmark, parse_args, 0, 8, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/bookmark", "/bookmark",
"/bookmark list", "/bookmark list",
@ -671,7 +671,7 @@ static struct cmd_t command_defs[] =
{ "/disco", { "/disco",
cmd_disco, parse_args, 1, 2, NULL, cmd_disco, parse_args, 1, 2, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/disco info [<jid>]", "/disco info [<jid>]",
"/disco items [<jid>]", "/disco items [<jid>]",
@ -693,7 +693,7 @@ static struct cmd_t command_defs[] =
{ "/nick", { "/nick",
cmd_nick, parse_args_with_freetext, 1, 1, NULL, cmd_nick, parse_args_with_freetext, 1, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/nick <nickname>", "/nick <nickname>",
NULL NULL
@ -708,7 +708,7 @@ static struct cmd_t command_defs[] =
{ "/win", { "/win",
cmd_win, parse_args, 1, 1, NULL, cmd_win, parse_args, 1, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/win <num>", "/win <num>",
NULL NULL
@ -723,7 +723,7 @@ static struct cmd_t command_defs[] =
{ "/wins", { "/wins",
cmd_wins, parse_args, 0, 3, NULL, cmd_wins, parse_args, 0, 3, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/wins tidy", "/wins tidy",
"/wins prune", "/wins prune",
@ -743,7 +743,7 @@ static struct cmd_t command_defs[] =
{ "/sub", { "/sub",
cmd_sub, parse_args, 1, 2, NULL, cmd_sub, parse_args, 1, 2, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/sub request [<jid>]", "/sub request [<jid>]",
"/sub allow [<jid>]", "/sub allow [<jid>]",
@ -773,7 +773,7 @@ static struct cmd_t command_defs[] =
{ "/tiny", { "/tiny",
cmd_tiny, parse_args, 1, 1, NULL, cmd_tiny, parse_args, 1, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/tiny <url>", "/tiny <url>",
NULL NULL
@ -789,7 +789,7 @@ static struct cmd_t command_defs[] =
{ "/who", { "/who",
cmd_who, parse_args, 0, 2, NULL, cmd_who, parse_args, 0, 2, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/who", "/who",
"/who online|offline|away|dnd|xa|chat|available|unavailable|any [<group>]", "/who online|offline|away|dnd|xa|chat|available|unavailable|any [<group>]",
@ -820,7 +820,7 @@ static struct cmd_t command_defs[] =
{ "/close", { "/close",
cmd_close, parse_args, 0, 1, NULL, cmd_close, parse_args, 0, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/close [<num>]", "/close [<num>]",
"/close all|read", "/close all|read",
@ -839,7 +839,7 @@ static struct cmd_t command_defs[] =
{ "/clear", { "/clear",
cmd_clear, parse_args, 0, 0, NULL, cmd_clear, parse_args, 0, 0, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/clear", "/clear",
NULL NULL
@ -853,7 +853,7 @@ static struct cmd_t command_defs[] =
{ "/quit", { "/quit",
cmd_quit, parse_args, 0, 0, NULL, cmd_quit, parse_args, 0, 0, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/quit", "/quit",
NULL NULL
@ -867,7 +867,7 @@ static struct cmd_t command_defs[] =
{ "/privileges", { "/privileges",
cmd_privileges, parse_args, 1, 1, &cons_privileges_setting, cmd_privileges, parse_args, 1, 1, &cons_privileges_setting,
{ NULL, NULL, { NULL }, {
{ {
"/privileges on|off", "/privileges on|off",
NULL NULL
@ -882,7 +882,7 @@ static struct cmd_t command_defs[] =
{ "/beep", { "/beep",
cmd_beep, parse_args, 1, 1, &cons_beep_setting, cmd_beep, parse_args, 1, 1, &cons_beep_setting,
{ NULL, NULL, { NULL }, {
{ {
"/beep on|off", "/beep on|off",
NULL NULL
@ -899,7 +899,7 @@ static struct cmd_t command_defs[] =
{ "/encwarn", { "/encwarn",
cmd_encwarn, parse_args, 1, 1, &cons_encwarn_setting, cmd_encwarn, parse_args, 1, 1, &cons_encwarn_setting,
{ NULL, NULL, { NULL }, {
{ {
"/encwarn on|off", "/encwarn on|off",
NULL NULL
@ -914,7 +914,7 @@ static struct cmd_t command_defs[] =
{ "/presence", { "/presence",
cmd_presence, parse_args, 1, 1, &cons_presence_setting, cmd_presence, parse_args, 1, 1, &cons_presence_setting,
{ NULL, NULL, { NULL }, {
{ {
"/presence on|off", "/presence on|off",
NULL NULL
@ -929,7 +929,7 @@ static struct cmd_t command_defs[] =
{ "/wrap", { "/wrap",
cmd_wrap, parse_args, 1, 1, &cons_wrap_setting, cmd_wrap, parse_args, 1, 1, &cons_wrap_setting,
{ NULL, NULL, { NULL }, {
{ {
"/wrap on|off", "/wrap on|off",
NULL NULL
@ -944,7 +944,7 @@ static struct cmd_t command_defs[] =
{ "/winstidy", { "/winstidy",
cmd_winstidy, parse_args, 1, 1, &cons_winstidy_setting, cmd_winstidy, parse_args, 1, 1, &cons_winstidy_setting,
{ NULL, NULL, { NULL }, {
{ {
"/winstidy on|off", "/winstidy on|off",
NULL NULL
@ -959,7 +959,7 @@ static struct cmd_t command_defs[] =
{ "/time", { "/time",
cmd_time, parse_args, 1, 3, &cons_time_setting, cmd_time, parse_args, 1, 3, &cons_time_setting,
{ NULL, NULL, { NULL }, {
{ {
"/time main set <format>", "/time main set <format>",
"/time main off", "/time main off",
@ -987,7 +987,7 @@ static struct cmd_t command_defs[] =
{ "/inpblock", { "/inpblock",
cmd_inpblock, parse_args, 2, 2, &cons_inpblock_setting, cmd_inpblock, parse_args, 2, 2, &cons_inpblock_setting,
{ NULL, NULL, { NULL }, {
{ {
"/inpblock timeout <millis>", "/inpblock timeout <millis>",
"/inpblock dynamic on|off", "/inpblock dynamic on|off",
@ -1004,7 +1004,7 @@ static struct cmd_t command_defs[] =
{ "/notify", { "/notify",
cmd_notify, parse_args, 2, 3, &cons_notify_setting, cmd_notify, parse_args, 2, 3, &cons_notify_setting,
{ NULL, NULL, { NULL }, {
{ {
"/notify message on|off", "/notify message on|off",
"/notify message current on|off", "/notify message current on|off",
@ -1047,7 +1047,7 @@ static struct cmd_t command_defs[] =
{ "/flash", { "/flash",
cmd_flash, parse_args, 1, 1, &cons_flash_setting, cmd_flash, parse_args, 1, 1, &cons_flash_setting,
{ NULL, NULL, { NULL }, {
{ {
"/flash on|off", "/flash on|off",
NULL NULL
@ -1063,7 +1063,7 @@ static struct cmd_t command_defs[] =
{ "/intype", { "/intype",
cmd_intype, parse_args, 1, 1, &cons_intype_setting, cmd_intype, parse_args, 1, 1, &cons_intype_setting,
{ NULL, NULL, { NULL }, {
{ {
"/intype on|off", "/intype on|off",
NULL NULL
@ -1079,7 +1079,7 @@ static struct cmd_t command_defs[] =
{ "/splash", { "/splash",
cmd_splash, parse_args, 1, 1, &cons_splash_setting, cmd_splash, parse_args, 1, 1, &cons_splash_setting,
{ NULL, NULL, { NULL }, {
{ {
"/splash on|off", "/splash on|off",
NULL NULL
@ -1094,7 +1094,7 @@ static struct cmd_t command_defs[] =
{ "/autoconnect", { "/autoconnect",
cmd_autoconnect, parse_args, 1, 2, &cons_autoconnect_setting, cmd_autoconnect, parse_args, 1, 2, &cons_autoconnect_setting,
{ NULL, NULL, { NULL }, {
{ {
"/autoconnect set <account>", "/autoconnect set <account>",
"/autoconnect off", "/autoconnect off",
@ -1114,7 +1114,7 @@ static struct cmd_t command_defs[] =
{ "/vercheck", { "/vercheck",
cmd_vercheck, parse_args, 0, 1, NULL, cmd_vercheck, parse_args, 0, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/vercheck on|off", "/vercheck on|off",
NULL NULL
@ -1129,7 +1129,7 @@ static struct cmd_t command_defs[] =
{ "/titlebar", { "/titlebar",
cmd_titlebar, parse_args, 2, 2, &cons_titlebar_setting, cmd_titlebar, parse_args, 2, 2, &cons_titlebar_setting,
{ NULL, NULL, { NULL }, {
{ {
"/titlebar show on|off", "/titlebar show on|off",
"/titlebar goodbye on|off", "/titlebar goodbye on|off",
@ -1146,7 +1146,7 @@ static struct cmd_t command_defs[] =
{ "/alias", { "/alias",
cmd_alias, parse_args_with_freetext, 1, 3, NULL, cmd_alias, parse_args_with_freetext, 1, 3, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/alias list", "/alias list",
"/alias add <name> <value>", "/alias add <name> <value>",
@ -1170,7 +1170,7 @@ static struct cmd_t command_defs[] =
{ "/chlog", { "/chlog",
cmd_chlog, parse_args, 1, 1, &cons_chlog_setting, cmd_chlog, parse_args, 1, 1, &cons_chlog_setting,
{ NULL, NULL, { NULL }, {
{ {
"/chlog on|off", "/chlog on|off",
NULL NULL
@ -1188,7 +1188,7 @@ static struct cmd_t command_defs[] =
{ "/grlog", { "/grlog",
cmd_grlog, parse_args, 1, 1, &cons_grlog_setting, cmd_grlog, parse_args, 1, 1, &cons_grlog_setting,
{ NULL, NULL, { NULL }, {
{ {
"/grlog on|off", "/grlog on|off",
NULL NULL
@ -1204,7 +1204,7 @@ static struct cmd_t command_defs[] =
{ "/states", { "/states",
cmd_states, parse_args, 1, 1, &cons_states_setting, cmd_states, parse_args, 1, 1, &cons_states_setting,
{ NULL, NULL, { NULL }, {
{ {
"/states on|off", "/states on|off",
NULL NULL
@ -1219,7 +1219,7 @@ static struct cmd_t command_defs[] =
{ "/pgp", { "/pgp",
cmd_pgp, parse_args, 1, 3, NULL, cmd_pgp, parse_args, 1, 3, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/pgp libver", "/pgp libver",
"/pgp keys", "/pgp keys",
@ -1252,7 +1252,7 @@ static struct cmd_t command_defs[] =
{ "/otr", { "/otr",
cmd_otr, parse_args, 1, 3, NULL, cmd_otr, parse_args, 1, 3, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/otr libver", "/otr libver",
"/otr gen", "/otr gen",
@ -1299,7 +1299,7 @@ static struct cmd_t command_defs[] =
{ "/outtype", { "/outtype",
cmd_outtype, parse_args, 1, 1, &cons_outtype_setting, cmd_outtype, parse_args, 1, 1, &cons_outtype_setting,
{ NULL, NULL, { NULL }, {
{ {
"/outtype on|off", "/outtype on|off",
NULL NULL
@ -1314,7 +1314,7 @@ static struct cmd_t command_defs[] =
{ "/gone", { "/gone",
cmd_gone, parse_args, 1, 1, &cons_gone_setting, cmd_gone, parse_args, 1, 1, &cons_gone_setting,
{ NULL, NULL, { NULL }, {
{ {
"/gone <minutes>", "/gone <minutes>",
NULL NULL
@ -1330,7 +1330,7 @@ static struct cmd_t command_defs[] =
{ "/history", { "/history",
cmd_history, parse_args, 1, 1, &cons_history_setting, cmd_history, parse_args, 1, 1, &cons_history_setting,
{ NULL, NULL, { NULL }, {
{ {
"/history on|off", "/history on|off",
NULL NULL
@ -1346,7 +1346,7 @@ static struct cmd_t command_defs[] =
{ "/log", { "/log",
cmd_log, parse_args, 1, 2, &cons_log_setting, cmd_log, parse_args, 1, 2, &cons_log_setting,
{ NULL, NULL, { NULL }, {
{ {
"/log where", "/log where",
"/log rotate on|off", "/log rotate on|off",
@ -1367,7 +1367,7 @@ static struct cmd_t command_defs[] =
{ "/carbons", { "/carbons",
cmd_carbons, parse_args, 1, 1, &cons_carbons_setting, cmd_carbons, parse_args, 1, 1, &cons_carbons_setting,
{ NULL, NULL, { NULL }, {
{ {
"/carbons on|off", "/carbons on|off",
NULL NULL
@ -1383,7 +1383,7 @@ static struct cmd_t command_defs[] =
{ "/receipts", { "/receipts",
cmd_receipts, parse_args, 2, 2, &cons_receipts_setting, cmd_receipts, parse_args, 2, 2, &cons_receipts_setting,
{ NULL, NULL, { NULL }, {
{ {
"/receipts request on|off", "/receipts request on|off",
"/receipts send on|off", "/receipts send on|off",
@ -1400,7 +1400,7 @@ static struct cmd_t command_defs[] =
{ "/reconnect", { "/reconnect",
cmd_reconnect, parse_args, 1, 1, &cons_reconnect_setting, cmd_reconnect, parse_args, 1, 1, &cons_reconnect_setting,
{ NULL, NULL, { NULL }, {
{ {
"/reconnect <seconds>", "/reconnect <seconds>",
NULL NULL
@ -1415,7 +1415,7 @@ static struct cmd_t command_defs[] =
{ "/autoping", { "/autoping",
cmd_autoping, parse_args, 1, 1, &cons_autoping_setting, cmd_autoping, parse_args, 1, 1, &cons_autoping_setting,
{ NULL, NULL, { NULL }, {
{ {
"/autoping <seconds>", "/autoping <seconds>",
NULL NULL
@ -1430,7 +1430,7 @@ static struct cmd_t command_defs[] =
{ "/ping", { "/ping",
cmd_ping, parse_args, 0, 1, NULL, cmd_ping, parse_args, 0, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/ping [<jid>]", "/ping [<jid>]",
NULL NULL
@ -1446,7 +1446,7 @@ static struct cmd_t command_defs[] =
{ "/autoaway", { "/autoaway",
cmd_autoaway, parse_args_with_freetext, 2, 2, &cons_autoaway_setting, cmd_autoaway, parse_args_with_freetext, 2, 2, &cons_autoaway_setting,
{ NULL, NULL, { NULL }, {
{ {
"/autoaway mode idle|away|off", "/autoaway mode idle|away|off",
"/autoaway time <minutes>", "/autoaway time <minutes>",
@ -1474,7 +1474,7 @@ static struct cmd_t command_defs[] =
{ "/priority", { "/priority",
cmd_priority, parse_args, 1, 1, &cons_priority_setting, cmd_priority, parse_args, 1, 1, &cons_priority_setting,
{ NULL, NULL, { NULL }, {
{ {
"/priority <priority>", "/priority <priority>",
NULL NULL
@ -1490,7 +1490,7 @@ static struct cmd_t command_defs[] =
{ "/account", { "/account",
cmd_account, parse_args, 0, 4, NULL, cmd_account, parse_args, 0, 4, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/account", "/account",
"/account list", "/account list",
@ -1567,7 +1567,7 @@ static struct cmd_t command_defs[] =
{ "/prefs", { "/prefs",
cmd_prefs, parse_args, 0, 1, NULL, cmd_prefs, parse_args, 0, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/prefs [ui|desktop|chat|log|conn|presence]", "/prefs [ui|desktop|chat|log|conn|presence]",
NULL NULL
@ -1588,7 +1588,7 @@ static struct cmd_t command_defs[] =
{ "/theme", { "/theme",
cmd_theme, parse_args, 1, 2, &cons_theme_setting, cmd_theme, parse_args, 1, 2, &cons_theme_setting,
{ NULL, NULL, { NULL }, {
{ {
"/theme list", "/theme list",
"/theme load <theme>", "/theme load <theme>",
@ -1609,7 +1609,7 @@ static struct cmd_t command_defs[] =
{ "/statuses", { "/statuses",
cmd_statuses, parse_args, 2, 2, &cons_statuses_setting, cmd_statuses, parse_args, 2, 2, &cons_statuses_setting,
{ NULL, NULL, { NULL }, {
{ {
"/statuses console|chat|muc all|online|none", "/statuses console|chat|muc all|online|none",
NULL NULL
@ -1633,7 +1633,7 @@ static struct cmd_t command_defs[] =
{ "/xmlconsole", { "/xmlconsole",
cmd_xmlconsole, parse_args, 0, 0, NULL, cmd_xmlconsole, parse_args, 0, 0, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/xmlconsole", "/xmlconsole",
NULL NULL
@ -1647,7 +1647,7 @@ static struct cmd_t command_defs[] =
{ "/away", { "/away",
cmd_away, parse_args_with_freetext, 0, 1, NULL, cmd_away, parse_args_with_freetext, 0, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/away [<message>]", "/away [<message>]",
NULL NULL
@ -1664,7 +1664,7 @@ static struct cmd_t command_defs[] =
{ "/chat", { "/chat",
cmd_chat, parse_args_with_freetext, 0, 1, NULL, cmd_chat, parse_args_with_freetext, 0, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/chat [<message>]", "/chat [<message>]",
NULL NULL
@ -1681,7 +1681,7 @@ static struct cmd_t command_defs[] =
{ "/dnd", { "/dnd",
cmd_dnd, parse_args_with_freetext, 0, 1, NULL, cmd_dnd, parse_args_with_freetext, 0, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/dnd [<message>]", "/dnd [<message>]",
NULL NULL
@ -1698,7 +1698,7 @@ static struct cmd_t command_defs[] =
{ "/online", { "/online",
cmd_online, parse_args_with_freetext, 0, 1, NULL, cmd_online, parse_args_with_freetext, 0, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/online [<message>]", "/online [<message>]",
NULL NULL
@ -1715,7 +1715,7 @@ static struct cmd_t command_defs[] =
{ "/xa", { "/xa",
cmd_xa, parse_args_with_freetext, 0, 1, NULL, cmd_xa, parse_args_with_freetext, 0, 1, NULL,
{ NULL, NULL, { NULL }, {
{ {
"/xa [<message>]", "/xa [<message>]",
NULL NULL
@ -2502,10 +2502,10 @@ _cmd_execute(ProfWin *window, const char * const command, const char * const inp
if (cmd) { if (cmd) {
gchar **args = cmd->parser(inp, cmd->min_args, cmd->max_args, &result); gchar **args = cmd->parser(inp, cmd->min_args, cmd->max_args, &result);
if (result == FALSE) { if (result == FALSE) {
ui_invalid_command_usage(cmd->help.usage, cmd->setting_func); ui_invalid_command_usage(cmd->cmd, cmd->setting_func);
return TRUE; return TRUE;
} else { } else {
gboolean result = cmd->func(window, args, cmd->help); gboolean result = cmd->func(window, args, command);
g_strfreev(args); g_strfreev(args);
return result; return result;
} }

File diff suppressed because it is too large Load Diff

View File

@ -39,10 +39,6 @@
// Command help strings // Command help strings
typedef struct cmd_help_t { typedef struct cmd_help_t {
const gchar *usage;
const gchar *short_help;
const gchar *long_help[50];
const gchar *synopsis[50]; const gchar *synopsis[50];
const gchar *desc; const gchar *desc;
const gchar *args[50][2]; const gchar *args[50][2];
@ -61,7 +57,7 @@ typedef struct cmd_help_t {
*/ */
typedef struct cmd_t { typedef struct cmd_t {
gchar *cmd; gchar *cmd;
gboolean (*func)(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean (*func)(ProfWin *window, gchar **args, const char * const command);
gchar** (*parser)(const char * const inp, int min, int max, gboolean *result); gchar** (*parser)(const char * const inp, int min, int max, gboolean *result);
int min_args; int min_args;
int max_args; int max_args;
@ -72,85 +68,85 @@ typedef struct cmd_t {
gboolean cmd_execute_alias(ProfWin *window, const char * const inp, gboolean *ran); gboolean cmd_execute_alias(ProfWin *window, const char * const inp, gboolean *ran);
gboolean cmd_execute_default(ProfWin *window, const char * inp); gboolean cmd_execute_default(ProfWin *window, const char * inp);
gboolean cmd_about(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_about(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_account(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_account(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_autoaway(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_autoaway(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_autoconnect(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_autoconnect(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_autoping(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_autoping(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_away(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_away(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_beep(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_beep(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_caps(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_caps(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_chat(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_chat(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_chlog(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_chlog(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_clear(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_clear(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_close(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_close(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_connect(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_connect(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_decline(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_decline(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_disco(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_disco(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_disconnect(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_disconnect(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_dnd(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_dnd(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_flash(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_flash(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_gone(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_gone(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_grlog(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_grlog(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_group(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_group(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_help(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_help(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_history(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_history(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_carbons(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_carbons(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_receipts(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_receipts(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_info(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_info(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_intype(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_intype(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_invite(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_invite(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_invites(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_invites(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_join(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_join(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_leave(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_leave(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_log(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_log(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_msg(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_msg(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_nick(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_nick(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_notify(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_notify(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_online(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_online(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_otr(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_otr(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_pgp(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_pgp(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_outtype(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_outtype(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_prefs(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_prefs(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_priority(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_priority(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_quit(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_quit(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_reconnect(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_reconnect(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_room(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_room(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_rooms(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_rooms(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_bookmark(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_bookmark(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_roster(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_roster(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_software(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_software(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_splash(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_splash(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_states(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_states(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_status(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_status(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_statuses(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_statuses(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_sub(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_sub(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_theme(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_theme(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_tiny(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_tiny(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_titlebar(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_titlebar(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_vercheck(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_vercheck(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_who(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_who(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_win(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_win(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_wins(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_wins(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_winstidy(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_winstidy(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_xa(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_xa(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_alias(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_alias(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_xmlconsole(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_xmlconsole(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_ping(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_ping(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_form(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_form(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_occupants(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_occupants(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_kick(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_kick(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_ban(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_ban(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_subject(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_subject(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_affiliation(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_affiliation(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_role(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_role(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_privileges(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_privileges(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_presence(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_presence(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_wrap(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_wrap(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_time(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_time(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_resource(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_resource(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_inpblock(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_inpblock(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_encwarn(ProfWin *window, gchar **args, struct cmd_help_t help); gboolean cmd_encwarn(ProfWin *window, gchar **args, const char * const command);
gboolean cmd_form_field(ProfWin *window, char *tag, gchar **args); gboolean cmd_form_field(ProfWin *window, char *tag, gchar **args);

View File

@ -141,6 +141,18 @@ cons_show_help(Command *command)
} }
} }
void
cons_bad_cmd_usage(const char * const cmd)
{
GString *msg = g_string_new("");
g_string_printf(msg, "Invalid usage, see '/help %s' for details.", &cmd[1]);
cons_show("");
cons_show(msg->str);
g_string_free(msg, TRUE);
}
void void
cons_show_error(const char * const msg, ...) cons_show_error(const char * const msg, ...)
{ {

View File

@ -667,22 +667,25 @@ ui_handle_error(const char * const err_msg)
} }
void void
ui_invalid_command_usage(const char * const usage, void (*setting_func)(void)) ui_invalid_command_usage(const char * const cmd, void (*setting_func)(void))
{ {
GString *msg = g_string_new("");
g_string_printf(msg, "Invalid usage, see '/help %s' for details.", &cmd[1]);
if (setting_func) { if (setting_func) {
cons_show(""); cons_show("");
(*setting_func)(); (*setting_func)();
cons_show("Usage: %s", usage); cons_show(msg->str);
} else { } else {
cons_show(""); cons_show("");
cons_show("Usage: %s", usage); cons_show(msg->str);
ProfWin *current = wins_get_current(); ProfWin *current = wins_get_current();
if (current->type == WIN_CHAT) { if (current->type == WIN_CHAT) {
char usage_cpy[strlen(usage) + 8]; ui_current_print_line(msg->str);
sprintf(usage_cpy, "Usage: %s", usage);
ui_current_print_line(usage_cpy);
} }
} }
g_string_free(msg, TRUE);
} }
void void

View File

@ -228,7 +228,7 @@ void ui_input_clear(void);
void ui_input_nonblocking(gboolean); void ui_input_nonblocking(gboolean);
void ui_write(char *line, int offset); void ui_write(char *line, int offset);
void ui_invalid_command_usage(const char * const usage, void (*setting_func)(void)); void ui_invalid_command_usage(const char * const cmd, void (*setting_func)(void));
void ui_create_xmlconsole_win(void); void ui_create_xmlconsole_win(void);
gboolean ui_xmlconsole_exists(void); gboolean ui_xmlconsole_exists(void);
@ -243,6 +243,7 @@ void cons_show(const char * const msg, ...);
void cons_about(void); void cons_about(void);
void cons_help(void); void cons_help(void);
void cons_show_help(Command *command); void cons_show_help(Command *command);
void cons_bad_cmd_usage(const char * const cmd);
void cons_navigation_help(void); void cons_navigation_help(void);
void cons_prefs(void); void cons_prefs(void);
void cons_show_ui_prefs(void); void cons_show_ui_prefs(void);