Format cmd_defs

Format it more readable and disable clang for this part.
Was messed up in 9b55f2dec0.
This commit is contained in:
Michael Vetter
2020-07-15 11:04:18 +02:00
parent 39315483a8
commit 0d8b62c9a2

View File

@@ -123,6 +123,8 @@ static gboolean _cmd_has_tag(Command* pcmd, const char* const tag);
/*
* Command list
*/
// clang-format off
static struct cmd_t command_defs[] = {
{ "/help",
parse_args_with_freetext, 0, 2, NULL,
@@ -146,7 +148,8 @@ static struct cmd_t command_defs[] = {
"/help search_all presence online",
"/help commands",
"/help presence",
"/help who") },
"/help who")
},
{ "/about",
parse_args, 0, 0, NULL,
@@ -158,7 +161,8 @@ static struct cmd_t command_defs[] = {
CMD_DESC(
"Show version and license information.")
CMD_NOARGS
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/connect",
parse_args, 0, 7, NULL,
@@ -190,7 +194,8 @@ static struct cmd_t command_defs[] = {
"/connect odin@valhalla.edda server talk.google.com",
"/connect freyr@vanaheimr.edda port 5678",
"/connect me@localhost.test.org server 127.0.0.1 tls disable",
"/connect me@chatty server chatty.com port 5443") },
"/connect me@chatty server chatty.com port 5443")
},
{ "/tls",
parse_args, 1, 3, NULL,
@@ -231,7 +236,8 @@ static struct cmd_t command_defs[] = {
{ "certpath set <path>", "Specify filesystem path containing trusted certificates." },
{ "certpath clear", "Clear the trusted certificate path." },
{ "certpath default", "Use default system certificate path, if it can be found." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/disconnect",
parse_args, 0, 0, NULL,
@@ -244,7 +250,8 @@ static struct cmd_t command_defs[] = {
CMD_DESC(
"Disconnect from the current chat service.")
CMD_NOARGS
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/msg",
parse_args_with_freetext, 1, 2, NULL,
@@ -268,7 +275,8 @@ static struct cmd_t command_defs[] = {
"/msg thor@valhalla.edda Hey, here's a message!",
"/msg heimdall@valhalla.edda",
"/msg Thor Here is a private message",
"/msg \"My Friend\" Hi, how are you?") },
"/msg \"My Friend\" Hi, how are you?")
},
{ "/roster",
parse_args_with_freetext, 0, 4, NULL,
@@ -410,7 +418,8 @@ static struct cmd_t command_defs[] = {
"/roster group show friends",
"/roster group add friends fenris@ownserver.org",
"/roster group add family Brother",
"/roster group remove colleagues boss@work.com") },
"/roster group remove colleagues boss@work.com")
},
{ "/blocked",
parse_args, 0, 2, NULL,
@@ -431,7 +440,8 @@ static struct cmd_t command_defs[] = {
{ "remove <jid>", "Remove the specified Jabber ID from the blocked list." })
CMD_EXAMPLES(
"/blocked add hel@helheim.edda",
"/blocked add profanity@rooms.dismail.de/spammy-user") },
"/blocked add profanity@rooms.dismail.de/spammy-user")
},
{ "/info",
parse_args, 0, 1, NULL,
@@ -453,7 +463,8 @@ static struct cmd_t command_defs[] = {
{ "<nick>", "When in a chat room, the occupant you wish to view information about." })
CMD_EXAMPLES(
"/info thor@aasgard.server.org",
"/info heimdall") },
"/info heimdall")
},
{ "/caps",
parse_args, 0, 1, NULL,
@@ -475,7 +486,8 @@ static struct cmd_t command_defs[] = {
CMD_EXAMPLES(
"/caps ran@cold.sea.org/laptop",
"/caps ran@cold.sea.org/phone",
"/caps aegir") },
"/caps aegir")
},
{ "/software",
parse_args, 0, 1, NULL,
@@ -498,7 +510,8 @@ static struct cmd_t command_defs[] = {
CMD_EXAMPLES(
"/software odin@valhalla.edda/laptop",
"/software odin@valhalla.edda/phone",
"/software thor") },
"/software thor")
},
{ "/status",
parse_args, 2, 3, NULL,
@@ -523,7 +536,8 @@ static struct cmd_t command_defs[] = {
CMD_EXAMPLES(
"/status get odin@valhalla.edda",
"/status get jon",
"/status set online") },
"/status set online")
},
{ "/resource",
parse_args, 1, 2, &cons_resource_setting,
@@ -544,7 +558,8 @@ static struct cmd_t command_defs[] = {
{ "off", "Let the server choose which resource to route messages to." },
{ "title on|off", "Show or hide the current resource in the titlebar." },
{ "message on|off", "Show or hide the resource when showing an incoming message." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/join",
parse_args, 0, 5, NULL,
@@ -570,7 +585,8 @@ static struct cmd_t command_defs[] = {
"/join profanity@rooms.dismail.de",
"/join profanity@rooms.dismail.de nick mynick",
"/join private@conference.jabber.org nick mynick password mypassword",
"/join mychannel") },
"/join mychannel")
},
{ "/invite",
parse_args_with_freetext, 1, 3, NULL,
@@ -594,7 +610,8 @@ static struct cmd_t command_defs[] = {
CMD_EXAMPLES(
"/invite send gustavo@pollos.tx",
"/invite decline profanity@rooms.dismail.de",
"/invite list") },
"/invite list")
},
{ "/room",
parse_args, 1, 1, NULL,
@@ -610,7 +627,8 @@ static struct cmd_t command_defs[] = {
{ "accept", "Accept default room configuration." },
{ "destroy", "Reject default room configuration, and destroy the room." },
{ "config", "Edit room configuration." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/kick",
parse_args_with_freetext, 1, 2, NULL,
@@ -640,7 +658,8 @@ static struct cmd_t command_defs[] = {
CMD_ARGS(
{ "<jid>", "Bare JID of the user to ban from the room." },
{ "<reason>", "Optional reason for banning the user." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/subject",
parse_args_with_freetext, 0, 2, NULL,
@@ -662,7 +681,8 @@ static struct cmd_t command_defs[] = {
{ "prepend <text>", "Prepend text to the current room subject, use double quotes if a trailing space is needed." },
{ "append <text>", "Append text to the current room subject, use double quotes if a preceding space is needed." },
{ "clear", "Clear the room subject." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/affiliation",
parse_args_with_freetext, 1, 4, NULL,
@@ -679,7 +699,8 @@ static struct cmd_t command_defs[] = {
CMD_ARGS(
{ "set <affiliation> <jid> [<reason>]", "Set the affiliation of user with jid, with an optional reason." },
{ "list [<affiliation>]", "List all users with the specified affiliation, or all if none specified." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/role",
parse_args_with_freetext, 1, 4, NULL,
@@ -696,7 +717,8 @@ static struct cmd_t command_defs[] = {
CMD_ARGS(
{ "set <role> <nick> [<reason>]", "Set the role of occupant with nick, with an optional reason." },
{ "list [<role>]", "List all occupants with the specified role, or all if none specified." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/occupants",
parse_args, 1, 3, cons_occupants_setting,
@@ -732,7 +754,8 @@ static struct cmd_t command_defs[] = {
{ "header char <char>", "Prefix occupants headers with specified character." },
{ "header char none", "Remove occupants header character prefix." },
{ "wrap on|off", "Enable or disable line wrapping in occupants panel." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/form",
parse_args, 1, 2, NULL,
@@ -752,7 +775,8 @@ static struct cmd_t command_defs[] = {
{ "submit", "Submit the current form." },
{ "cancel", "Cancel changes to the current form." },
{ "help [<tag>]", "Display help for form, or a specific field." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/rooms",
parse_args, 0, 4, NULL,
@@ -779,7 +803,8 @@ static struct cmd_t command_defs[] = {
"/rooms",
"/rooms filter development",
"/rooms service conference.jabber.org",
"/rooms service conference.jabber.org filter \"News Room\"") },
"/rooms service conference.jabber.org filter \"News Room\"")
},
{ "/bookmark",
parse_args, 0, 8, NULL,
@@ -816,7 +841,8 @@ static struct cmd_t command_defs[] = {
{ "invites on|off", "Whether or not to bookmark accepted room invites, defaults to 'on'." },
{ "ignore add <barejid>", "Add a bookmark to the autojoin ignore list." },
{ "ignore remove <barejid>", "Remove a bookmark from the autojoin ignore list." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/disco",
parse_args, 1, 2, NULL,
@@ -837,7 +863,8 @@ static struct cmd_t command_defs[] = {
"/disco info",
"/disco items myserver.org",
"/disco items conference.jabber.org",
"/disco info odin@valhalla.edda/laptop") },
"/disco info odin@valhalla.edda/laptop")
},
{ "/sendfile",
parse_args_with_freetext, 1, 1, NULL,
@@ -854,7 +881,8 @@ static struct cmd_t command_defs[] = {
{ "<file>", "Path to the file." })
CMD_EXAMPLES(
"/sendfile /etc/hosts",
"/sendfile ~/images/sweet_cat.jpg") },
"/sendfile ~/images/sweet_cat.jpg")
},
{ "/lastactivity",
parse_args, 0, 1, NULL,
@@ -875,7 +903,8 @@ static struct cmd_t command_defs[] = {
"/lastactivity off",
"/lastactivity freyja@asgaard.edda",
"/lastactivity freyja@asgaard.edda/laptop",
"/lastactivity someserver.com") },
"/lastactivity someserver.com")
},
{ "/nick",
parse_args_with_freetext, 1, 1, NULL,
@@ -889,7 +918,8 @@ static struct cmd_t command_defs[] = {
"Change your nickname in the current chat room.")
CMD_ARGS(
{ "<nickname>", "Your new nickname." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/win",
parse_args, 1, 1, NULL,
@@ -924,7 +954,8 @@ static struct cmd_t command_defs[] = {
"/win Eddie",
"/win bigroom@conference.chat.org",
"/win bigroom@conference.chat.org/thor",
"/win wikipedia") },
"/win wikipedia")
},
{ "/wins",
parse_args, 0, 3, NULL,
@@ -947,7 +978,8 @@ static struct cmd_t command_defs[] = {
{ "unread", "List windows with unread messages." },
{ "prune", "Close all windows with no unread messages." },
{ "swap <source> <target>", "Swap windows, target may be an empty position." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/sub",
parse_args, 1, 2, NULL,
@@ -976,7 +1008,8 @@ static struct cmd_t command_defs[] = {
"/sub request odin@valhalla.edda",
"/sub allow odin@valhalla.edda",
"/sub request",
"/sub sent") },
"/sub sent")
},
{ "/who",
parse_args, 0, 2, NULL,
@@ -1008,7 +1041,8 @@ static struct cmd_t command_defs[] = {
"/who online friends",
"/who any family",
"/who participant",
"/who admin") },
"/who admin")
},
{ "/close",
parse_args, 0, 1, NULL,
@@ -1037,7 +1071,8 @@ static struct cmd_t command_defs[] = {
{ "xmlconsole", "Close the XML Console window if open." },
{ "all", "Close all windows." },
{ "read", "Close all windows that have no unread messages." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/clear",
parse_args, 0, 2, NULL,
@@ -1056,7 +1091,8 @@ static struct cmd_t command_defs[] = {
CMD_EXAMPLES(
"/clear",
"/clear persist_history",
"/clear persist_history on") },
"/clear persist_history on")
},
{ "/quit",
parse_args, 0, 0, NULL,
@@ -1068,7 +1104,8 @@ static struct cmd_t command_defs[] = {
CMD_DESC(
"Logout of any current session, and quit Profanity.")
CMD_NOARGS
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/privileges",
parse_args, 1, 1, &cons_privileges_setting,
@@ -1083,7 +1120,8 @@ static struct cmd_t command_defs[] = {
"Group occupants panel by role, and show role information in chat rooms.")
CMD_ARGS(
{ "on|off", "Enable or disable privilege information." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/charset",
parse_args, 0, 0, NULL,
@@ -1096,7 +1134,8 @@ static struct cmd_t command_defs[] = {
CMD_DESC(
"Display information about the current character set supported by the terminal. ")
CMD_NOARGS
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/beep",
parse_args, 1, 1, &cons_beep_setting,
@@ -1112,7 +1151,8 @@ static struct cmd_t command_defs[] = {
"If the terminal does not support sounds, it may attempt to flash the screen instead.")
CMD_ARGS(
{ "on|off", "Enable or disable terminal bell." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/console",
parse_args, 2, 2, &cons_console_setting,
@@ -1140,7 +1180,8 @@ static struct cmd_t command_defs[] = {
{ "private all", "Indicate all new private room messages in the console." },
{ "private first", "Indicate only the first private room message in the console." },
{ "private none", "Do not show any new private room messages in the console window." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/presence",
parse_args, 2, 2, &cons_presence_setting,
@@ -1172,7 +1213,8 @@ static struct cmd_t command_defs[] = {
"/presence titlebar off",
"/presence console none",
"/presence chat online",
"/presence room all") },
"/presence room all")
},
{ "/wrap",
parse_args, 1, 1, &cons_wrap_setting,
@@ -1186,7 +1228,8 @@ static struct cmd_t command_defs[] = {
"Word wrapping.")
CMD_ARGS(
{ "on|off", "Enable or disable word wrapping in the main window." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/time",
parse_args, 1, 3, &cons_time_setting,
@@ -1230,7 +1273,8 @@ static struct cmd_t command_defs[] = {
"/time xml off",
"/time statusbar set %H:%M",
"/time lastactivity set \"%d-%m-%y %H:%M:%S\"",
"/time all set \"%d-%m-%y %H:%M:%S\"") },
"/time all set \"%d-%m-%y %H:%M:%S\"")
},
{ "/inpblock",
parse_args, 2, 2, &cons_inpblock_setting,
@@ -1248,6 +1292,7 @@ static struct cmd_t command_defs[] = {
{ "dynamic on|off", "Start with 0 millis and dynamically increase up to timeout when no activity, default: on." })
CMD_NOEXAMPLES },
{ "/titlebar",
parse_args, 1, 2, &cons_titlebar_setting,
CMD_SUBFUNCS(
@@ -1273,7 +1318,8 @@ static struct cmd_t command_defs[] = {
CMD_EXAMPLES(
"/titlebar up",
"/titlebar show tls",
"/titlebar hide encwarn") },
"/titlebar hide encwarn")
},
{ "/mainwin",
parse_args, 1, 1, &cons_winpos_setting,
@@ -1289,7 +1335,8 @@ static struct cmd_t command_defs[] = {
CMD_ARGS(
{ "up", "Move the main window up the screen." },
{ "down", "Move the main window down the screen." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/statusbar",
parse_args, 1, 2, &cons_statusbar_setting,
@@ -1327,7 +1374,8 @@ static struct cmd_t command_defs[] = {
"/statusbar self user",
"/statusbar chat jid",
"/statusbar hide read",
"/statusbar hide name") },
"/statusbar hide name")
},
{ "/inputwin",
parse_args, 1, 1, &cons_winpos_setting,
@@ -1343,7 +1391,8 @@ static struct cmd_t command_defs[] = {
CMD_ARGS(
{ "up", "Move the input window up the screen." },
{ "down", "Move the input window down the screen." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/notify",
parse_args_with_freetext, 0, 4, NULL,
@@ -1414,7 +1463,8 @@ static struct cmd_t command_defs[] = {
"/notify room text off",
"/notify remind 60",
"/notify typing on",
"/notify invite on") },
"/notify invite on")
},
{ "/flash",
parse_args, 1, 1, &cons_flash_setting,
@@ -1429,7 +1479,8 @@ static struct cmd_t command_defs[] = {
"If the terminal doesn't support flashing, it may attempt to beep.")
CMD_ARGS(
{ "on|off", "Enable or disable terminal flash." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/tray",
parse_args, 1, 2, &cons_tray_setting,
@@ -1447,7 +1498,8 @@ static struct cmd_t command_defs[] = {
{ "on|off", "Show tray icon." },
{ "read on|off", "Show tray icon when no unread messages." },
{ "timer <seconds>", "Set tray icon timer, seconds must be between 1-10." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/intype",
parse_args, 1, 1, &cons_intype_setting,
@@ -1462,7 +1514,8 @@ static struct cmd_t command_defs[] = {
"Show when a contact is typing in the console, and in active message window.")
CMD_ARGS(
{ "on|off", "Enable or disable contact typing messages." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/splash",
parse_args, 1, 1, &cons_splash_setting,
@@ -1476,7 +1529,8 @@ static struct cmd_t command_defs[] = {
"Switch on or off the ascii logo on start up and when the /about command is called.")
CMD_ARGS(
{ "on|off", "Enable or disable splash logo." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/autoconnect",
parse_args, 1, 2, &cons_autoconnect_setting,
@@ -1495,7 +1549,8 @@ static struct cmd_t command_defs[] = {
{ "off", "Disable autoconnect." })
CMD_EXAMPLES(
"/autoconnect set ulfhednar@valhalla.edda",
"/autoconnect off") },
"/autoconnect off")
},
{ "/vercheck",
parse_args, 0, 1, NULL,
@@ -1509,7 +1564,8 @@ static struct cmd_t command_defs[] = {
"Check for new versions when Profanity starts, and when the /about command is run.")
CMD_ARGS(
{ "on|off", "Enable or disable the version check." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/wintitle",
parse_args, 2, 2, &cons_wintitle_setting,
@@ -1525,7 +1581,8 @@ static struct cmd_t command_defs[] = {
CMD_ARGS(
{ "show on|off", "Show current logged in user, and unread messages as the window title." },
{ "goodbye on|off", "Show a message in the title when exiting profanity." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/alias",
parse_args_with_freetext, 1, 3, NULL,
@@ -1547,7 +1604,8 @@ static struct cmd_t command_defs[] = {
"/alias add /q /quit",
"/alias add a /away \"I'm in a meeting.\"",
"/alias remove q",
"/alias list") },
"/alias list")
},
{ "/logging",
parse_args, 2, 3, &cons_logging_setting,
@@ -1567,7 +1625,8 @@ static struct cmd_t command_defs[] = {
{ "group on|off", "Enable/Disable groupchat (room) logging." })
CMD_EXAMPLES(
"/logging chat on",
"/logging group off") },
"/logging group off")
},
{ "/states",
parse_args, 1, 1, &cons_states_setting,
@@ -1619,7 +1678,8 @@ static struct cmd_t command_defs[] = {
"/pgp setkey odin@valhalla.edda BA19CACE5A9592C5",
"/pgp start odin@valhalla.edda",
"/pgp end",
"/pgp char P") },
"/pgp char P")
},
// XEP-0373: OpenPGP for XMPP
#ifdef HAVE_LIBGPGME
@@ -1659,7 +1719,8 @@ static struct cmd_t command_defs[] = {
"/ox log off",
"/ox start odin@valhalla.edda",
"/ox end",
"/ox char X") },
"/ox char X")
},
#endif // HAVE_LIBGPGME
{ "/otr",
@@ -1731,7 +1792,8 @@ static struct cmd_t command_defs[] = {
"/otr theirfp",
"/otr question \"What is the name of my rabbit?\" fiffi",
"/otr end",
"/otr char *") },
"/otr char *")
},
{ "/outtype",
parse_args, 1, 1, &cons_outtype_setting,
@@ -1745,7 +1807,8 @@ static struct cmd_t command_defs[] = {
"Send typing notifications, chat states (/states) will be enabled if this setting is enabled.")
CMD_ARGS(
{ "on|off", "Enable or disable sending typing notifications." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/gone",
parse_args, 1, 1, &cons_gone_setting,
@@ -1760,7 +1823,8 @@ static struct cmd_t command_defs[] = {
"Chat states (/states) will be enabled if this setting is set.")
CMD_ARGS(
{ "<minutes>", "Number of minutes of inactivity before sending the 'gone' state, a value of 0 will disable sending this state." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/history",
parse_args, 1, 1, &cons_history_setting,
@@ -1776,7 +1840,8 @@ static struct cmd_t command_defs[] = {
"When history is enabled, previous messages are shown in chat windows.")
CMD_ARGS(
{ "on|off", "Enable or disable showing chat history." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/log",
parse_args, 1, 2, &cons_log_setting,
@@ -1795,7 +1860,8 @@ static struct cmd_t command_defs[] = {
{ "rotate on|off", "Rotate log, default on." },
{ "maxsize <bytes>", "With rotate enabled, specifies the max log size, defaults to 1048580 (1MB)." },
{ "shared on|off", "Share logs between all instances, default: on. When off, the process id will be included in the log filename." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/carbons",
parse_args, 1, 1, &cons_carbons_setting,
@@ -1810,7 +1876,8 @@ static struct cmd_t command_defs[] = {
"Message carbons ensure that both sides of all conversations are shared with all the user's clients that implement this protocol.")
CMD_ARGS(
{ "on|off", "Enable or disable message carbons." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/receipts",
parse_args, 2, 2, &cons_receipts_setting,
@@ -1826,7 +1893,8 @@ static struct cmd_t command_defs[] = {
CMD_ARGS(
{ "request on|off", "Whether or not to request a receipt upon sending a message." },
{ "send on|off", "Whether or not to send a receipt if one has been requested with a received message." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/reconnect",
parse_args, 1, 1, &cons_reconnect_setting,
@@ -1840,7 +1908,8 @@ static struct cmd_t command_defs[] = {
"Set the reconnect attempt interval for when the connection is lost.")
CMD_ARGS(
{ "<seconds>", "Number of seconds before attempting to reconnect, a value of 0 disables reconnect." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/autoping",
parse_args, 2, 2, &cons_autoping_setting,
@@ -1856,7 +1925,8 @@ static struct cmd_t command_defs[] = {
CMD_ARGS(
{ "set <seconds>", "Number of seconds between sending pings, a value of 0 disables autoping." },
{ "timeout <seconds>", "Seconds to wait for autoping responses, after which the connection is considered broken." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/ping",
parse_args, 0, 1, NULL,
@@ -1871,7 +1941,8 @@ static struct cmd_t command_defs[] = {
"If no JID is supplied, your chat server will be pinged.")
CMD_ARGS(
{ "<jid>", "The Jabber ID to send the ping request to." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/autoaway",
parse_args_with_freetext, 2, 3, &cons_autoaway_setting,
@@ -1903,7 +1974,8 @@ static struct cmd_t command_defs[] = {
"/autoaway message away Away from computer for a while",
"/autoaway time xa 120",
"/autoaway message xa Away from computer for a very long time",
"/autoaway check off") },
"/autoaway check off")
},
{ "/priority",
parse_args, 1, 1, NULL,
@@ -1918,7 +1990,8 @@ static struct cmd_t command_defs[] = {
"See the /account command for specific priority settings per presence status.")
CMD_ARGS(
{ "<priority>", "Number between -128 and 127, default: 0." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/account",
parse_args, 0, 4, NULL,
@@ -2030,7 +2103,8 @@ static struct cmd_t command_defs[] = {
"/account set me status dnd",
"/account set me dnd -1",
"/account rename me chattyme",
"/account clear me pgpkeyid") },
"/account clear me pgpkeyid")
},
{ "/plugins",
parse_args, 0, 3, NULL,
@@ -2076,7 +2150,8 @@ static struct cmd_t command_defs[] = {
"/plugins uninstall browser.py",
"/plugins load browser.py",
"/plugins unload say.py",
"/plugins reload wikipedia.py") },
"/plugins reload wikipedia.py")
},
{ "/prefs",
parse_args, 0, 1, NULL,
@@ -2098,7 +2173,8 @@ static struct cmd_t command_defs[] = {
{ "otr", "Off The Record preferences." },
{ "pgp", "OpenPGP preferences." },
{ "omemo", "OMEMO preferences." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/theme",
parse_args, 1, 2, &cons_theme_setting,
@@ -2122,7 +2198,8 @@ static struct cmd_t command_defs[] = {
{ "properties", "Show colour settings for current theme." })
CMD_EXAMPLES(
"/theme list",
"/theme load forest") },
"/theme load forest")
},
{ "/xmlconsole",
parse_args, 0, 0, NULL,
@@ -2135,7 +2212,8 @@ static struct cmd_t command_defs[] = {
CMD_DESC(
"Open the XML console to view incoming and outgoing XMPP traffic.")
CMD_NOARGS
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/script",
parse_args, 1, 2, NULL,
@@ -2156,7 +2234,8 @@ static struct cmd_t command_defs[] = {
CMD_EXAMPLES(
"/script list",
"/script run myscript",
"/script show somescript") },
"/script show somescript")
},
{ "/export",
parse_args, 1, 1, NULL,
@@ -2171,7 +2250,8 @@ static struct cmd_t command_defs[] = {
{ "<filepath>", "Path to the output file." })
CMD_EXAMPLES(
"/export /path/to/output.csv",
"/export ~/contacts.csv") },
"/export ~/contacts.csv")
},
{ "/cmd",
parse_args, 1, 3, NULL,
@@ -2190,7 +2270,8 @@ static struct cmd_t command_defs[] = {
{ "exec <command>", "Execute a command." })
CMD_EXAMPLES(
"/cmd list",
"/cmd exec ping") },
"/cmd exec ping")
},
{ "/omemo",
parse_args, 1, 3, NULL,
@@ -2241,7 +2322,8 @@ static struct cmd_t command_defs[] = {
"/omemo start odin@valhalla.edda",
"/omemo trust c4f9c875-144d7a3b-0c4a05b6-ca3be51a-a037f329-0bd3ae62-07f99719-55559d2a",
"/omemo untrust loki@valhalla.edda c4f9c875-144d7a3b-0c4a05b6-ca3be51a-a037f329-0bd3ae62-07f99719-55559d2a",
"/omemo char *") },
"/omemo char *")
},
{ "/save",
parse_args, 0, 0, NULL,
@@ -2253,7 +2335,8 @@ static struct cmd_t command_defs[] = {
CMD_DESC(
"Save preferences to configuration file.")
CMD_NOARGS
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/reload",
parse_args, 0, 0, NULL,
@@ -2265,7 +2348,8 @@ static struct cmd_t command_defs[] = {
CMD_DESC(
"Reload preferences from configuration file.")
CMD_NOARGS
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/paste",
parse_args, 0, 0, NULL,
@@ -2277,7 +2361,8 @@ static struct cmd_t command_defs[] = {
CMD_DESC(
"Paste clipboard.")
CMD_NOARGS
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/color",
parse_args, 1, 2, &cons_color_setting,
@@ -2298,7 +2383,8 @@ static struct cmd_t command_defs[] = {
"/color off",
"/color on",
"/color blue",
"/color own off") },
"/color own off")
},
{ "/avatar",
parse_args, 2, 2, NULL,
@@ -2332,7 +2418,8 @@ static struct cmd_t command_defs[] = {
"Choose whether to include the OS name if a user asks for software information (XEP-0092).")
CMD_ARGS(
{ "on|off", "" })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/correction",
parse_args, 1, 2, &cons_correction_setting,
@@ -2352,7 +2439,8 @@ static struct cmd_t command_defs[] = {
CMD_ARGS(
{ "on|off", "Enable/Disable support for last message correction." },
{ "char", "Set character that will prefix corrected messages. Default: '+'." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/correct",
parse_args, 1, -1, NULL,
@@ -2369,7 +2457,8 @@ static struct cmd_t command_defs[] = {
"For more information on how to configure corrections, see: /help correction.")
CMD_ARGS(
{ "message", "The corrected message." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/slashguard",
parse_args, 1, 1, &cons_slashguard_setting,
@@ -2385,7 +2474,8 @@ static struct cmd_t command_defs[] = {
"It tries to protect you from typing ' /quit' and similar things in chats.")
CMD_ARGS(
{ "on|off", "Enable or disable slashguard." })
CMD_NOEXAMPLES },
CMD_NOEXAMPLES
},
{ "/serversoftware",
parse_args, 1, 1, NULL,
@@ -2401,7 +2491,8 @@ static struct cmd_t command_defs[] = {
{ "<domain>", "The jid of your server or component." })
CMD_EXAMPLES(
"/software valhalla.edda",
"/software xmpp.vanaheimr.edda") },
"/software xmpp.vanaheimr.edda")
},
{ "/executable",
parse_args, 2, 4, &cons_executable_setting,
@@ -2424,7 +2515,8 @@ static struct cmd_t command_defs[] = {
"/executable avatar xdg-open",
"/executable urlopen DEF false \"xdg-open %u\"",
"/executable urlopen html false \"firefox %u\"",
"/executable urlsave aesgcm \"omut -d -o %p %u\"") },
"/executable urlsave aesgcm \"omut -d -o %p %u\"")
},
{ "/url",
parse_args, 2, 3, NULL,
@@ -2445,9 +2537,12 @@ static struct cmd_t command_defs[] = {
{ "save", "Save URL to optional path, default path is current directory" })
CMD_EXAMPLES(
"/url open https://profanity-im.github.io",
"/url save https://profanity-im.github.io/guide/latest/userguide.html /home/user/Download/") },
"/url save https://profanity-im.github.io/guide/latest/userguide.html /home/user/Download/")
},
};
// clang-format on
static GHashTable* search_index;
char*