mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Tidied help
This commit is contained in:
parent
8e90f7a414
commit
0bba09fd04
239
src/command.c
239
src/command.c
@ -135,13 +135,12 @@ static struct cmd_t main_commands[] =
|
||||
{
|
||||
{ "/help",
|
||||
_cmd_help, parse_args, 0, 1,
|
||||
{ "/help [list|area|command]", "Show help summary, or help on a specific area or command",
|
||||
{ "/help [list|area|command]", "Get help on using Profanity",
|
||||
{ "/help [list|area|command]",
|
||||
"-------------------------",
|
||||
"Show help options.",
|
||||
"Specify list if you want a list of all commands.",
|
||||
"Specify an area (basic, presence, settings, navigation) for more help on that area.",
|
||||
"Specify the command if you want more detailed help on a specific command.",
|
||||
"list : List of all commands.",
|
||||
"area : One of 'basic', 'presence', 'settings', 'navigation' for more summary help in that area.",
|
||||
"command : Detailed help on a specific command.",
|
||||
"",
|
||||
"Example : /help list",
|
||||
"Example : /help connect",
|
||||
@ -158,13 +157,11 @@ static struct cmd_t main_commands[] =
|
||||
|
||||
{ "/connect",
|
||||
_cmd_connect, parse_args, 1, 2,
|
||||
{ "/connect user@domain [server]", "Login to jabber.",
|
||||
{ "/connect user@domain [server]",
|
||||
"-----------------------------",
|
||||
"Connect to the jabber server at domain using the username user.",
|
||||
"Profanity should work with any XMPP (Jabber) compliant chat service.",
|
||||
"You can use tab completion to autocomplete any logins you have used before.",
|
||||
"Use the server option if the chat service is hosted at a different domain to the 'domain' part.",
|
||||
{ "/connect jid [server]", "Login to jabber.",
|
||||
{ "/connect jid [server]",
|
||||
"----------------------",
|
||||
"Connect to an XMPP service using the specified JID (Jabber ID).",
|
||||
"server : For chat services hosted at a different domain to the 'domain' part of the Jabber ID.",
|
||||
"",
|
||||
"Example: /connect myuser@gmail.com",
|
||||
"Example: /connect myuser@mycompany.com talk.google.com",
|
||||
@ -172,30 +169,26 @@ static struct cmd_t main_commands[] =
|
||||
|
||||
{ "/disconnect",
|
||||
_cmd_disconnect, parse_args, 0, 0,
|
||||
{ "/disconnect", "Logout of current jabber session.",
|
||||
{ "/disconnect", "Logout of current session.",
|
||||
{ "/disconnect",
|
||||
"------------------",
|
||||
"Disconnect from the current jabber session.",
|
||||
"See the /connect command for connecting again.",
|
||||
"Disconnect from the current session session.",
|
||||
NULL } } },
|
||||
|
||||
{ "/prefs",
|
||||
_cmd_prefs, parse_args, 0, 1,
|
||||
{ "/prefs [ui|desktop|chat|log|conn|presence]", "Show current preferences.",
|
||||
{ "/prefs [ui|desktop|chat|log|conn|presence]",
|
||||
"------------------------------------------",
|
||||
"Show current preferences.",
|
||||
"The argument narrows down the category of preferences, with no argument showing all.",
|
||||
"The preferences are stored in:",
|
||||
{ "/prefs [area]", "Show configuration.",
|
||||
{ "/prefs [area]",
|
||||
"-------------",
|
||||
"Area is one of:",
|
||||
"ui : User interface preferences.",
|
||||
"desktop : Desktop notification preferences.",
|
||||
"chat : Chat state preferences.",
|
||||
"log : Logging preferences.",
|
||||
"conn : Connection handling preferences.",
|
||||
"presence : Chat presence preferences.",
|
||||
"",
|
||||
" $XDG_CONFIG_HOME/profanity/profrc",
|
||||
"",
|
||||
"If the environment variable XDG_CONFIG_HOME is not set the following default if used:",
|
||||
"",
|
||||
" $HOME/.config/profanity/profrc",
|
||||
"",
|
||||
"Preference changes made using the various commands take effect immediately,",
|
||||
"you will need to restart Profanity for config file edits to take effect.",
|
||||
"No argument shows all categories.",
|
||||
NULL } } },
|
||||
|
||||
{ "/theme",
|
||||
@ -203,15 +196,9 @@ static struct cmd_t main_commands[] =
|
||||
{ "/theme command [theme-name]", "Change colour theme.",
|
||||
{ "/theme command [theme-name]",
|
||||
"---------------------------",
|
||||
"Change the colour setting as defined in:",
|
||||
"Change the colour settings used.",
|
||||
"",
|
||||
" $XDG_CONFIG_HOME/profanity/themes/theme-name",
|
||||
"",
|
||||
"If the environment variable XDG_CONFIG_HOME is not set the following default if used:",
|
||||
"",
|
||||
" $HOME/.config/profanity/themes/theme-name",
|
||||
"",
|
||||
"Command must be one of 'list' or 'load'.",
|
||||
"command : One of the following,",
|
||||
"list : List all available themes.",
|
||||
"set [theme-name] : Load the named theme.\"default\" will reset to the default colours.",
|
||||
"",
|
||||
@ -221,34 +208,34 @@ static struct cmd_t main_commands[] =
|
||||
|
||||
{ "/msg",
|
||||
_cmd_msg, parse_args_with_freetext, 1, 2,
|
||||
{ "/msg user@host [message]", "Start chat window with user.",
|
||||
{ "/msg user@host [message]",
|
||||
"------------------------",
|
||||
"Open a chat window with user@host and send the message if one is supplied.",
|
||||
"Use tab completion to autocomplete conacts from the roster.",
|
||||
{ "/msg jid [message]", "Start chat with user.",
|
||||
{ "/msg jid [message]",
|
||||
"------------------",
|
||||
"Open a chat window with for the user JID (Jabber ID) and send the message if one is supplied.",
|
||||
"When in a chat room, will start private chat with the room member.",
|
||||
"",
|
||||
"Example : /msg myfriend@server.com Hey, here's a message!",
|
||||
"Example : /msg otherfriend@server.com",
|
||||
"Example : /msg room@conference.server.com/nick A private message",
|
||||
NULL } } },
|
||||
|
||||
{ "/info",
|
||||
_cmd_info, parse_args, 1, 1,
|
||||
{ "/info user@host", "Find out a contacts presence information.",
|
||||
{ "/info user@host",
|
||||
"---------------",
|
||||
"Find out someones presence information.",
|
||||
"Use tab completion to autocomplete the contact.",
|
||||
{ "/info jid", "Find out a contacts presence information.",
|
||||
{ "/info jid",
|
||||
"---------",
|
||||
"Find out a contacts presence information.",
|
||||
NULL } } },
|
||||
|
||||
{ "/join",
|
||||
_cmd_join, parse_args_with_freetext, 1, 2,
|
||||
{ "/join room@server [nick]", "Join a chat room.",
|
||||
{ "/join room@server [nick]",
|
||||
"------------------------",
|
||||
{ "/join room [nick]", "Join a chat room.",
|
||||
{ "/join room [nick]",
|
||||
"-----------------",
|
||||
"Join a chat room at the conference server.",
|
||||
"If nick is specified you will join with this nickname,",
|
||||
"otherwise the first part of your JID (before the @) will be used.",
|
||||
"If the room doesn't exist, and the server allows it, a new one will be created."
|
||||
"If nick is specified you will join with this nickname.",
|
||||
"Otherwise the first part of your JID (before the @) will be used.",
|
||||
"If the room doesn't exist, and the server allows it, a new one will be created.",
|
||||
"",
|
||||
"Example : /join jdev@conference.jabber.org",
|
||||
"Example : /join jdev@conference.jabber.org mynick",
|
||||
@ -256,12 +243,11 @@ static struct cmd_t main_commands[] =
|
||||
|
||||
{ "/nick",
|
||||
_cmd_nick, parse_args_with_freetext, 1, 1,
|
||||
{ "/nick [nickname]", "Change nickname in chat room.",
|
||||
{ "/nick [nickname]",
|
||||
"------------------------",
|
||||
"Change the name by which other member of a chat room see you.",
|
||||
{ "/nick nickname", "Change nickname in chat room.",
|
||||
{ "/nick nickname",
|
||||
"--------------",
|
||||
"Change the name by which other members of a chat room see you.",
|
||||
"This command is only valid when called within a chat room window.",
|
||||
"The new nickname may contain spaces.",
|
||||
"",
|
||||
"Example : /nick kai hansen",
|
||||
"Example : /nick bob",
|
||||
@ -272,14 +258,15 @@ static struct cmd_t main_commands[] =
|
||||
{ "/wins", "List active windows.",
|
||||
{ "/wins",
|
||||
"-----",
|
||||
"List all currently active windows and information about them.",
|
||||
"List all currently active windows and information about their usage.",
|
||||
NULL } } },
|
||||
|
||||
{ "/sub",
|
||||
_cmd_sub, parse_args, 1, 2,
|
||||
{ "/sub <request|allow|deny|show|sent|received> [jid]", "Manage subscriptions.",
|
||||
{ "/sub <request|allow|deny|show|sent|received> [jid]",
|
||||
"--------------------------------------------------",
|
||||
{ "/sub command [jid]", "Manage subscriptions.",
|
||||
{ "/sub command [jid]",
|
||||
"------------------",
|
||||
"command : One of the following,",
|
||||
"request : Send a subscription request to the user to be informed of their",
|
||||
" : presence.",
|
||||
"allow : Approve a contact's subscription reqeust to see your presence.",
|
||||
@ -303,8 +290,7 @@ static struct cmd_t main_commands[] =
|
||||
{ "/tiny url",
|
||||
"---------",
|
||||
"Send the url as a tiny url.",
|
||||
"This command can only be called when in a chat window,",
|
||||
"not from the console.",
|
||||
"This command can only be called when in a chat window, not from the console.",
|
||||
"",
|
||||
"Example : /tiny http://www.google.com",
|
||||
NULL } } },
|
||||
@ -317,9 +303,9 @@ static struct cmd_t main_commands[] =
|
||||
"Show contacts with the specified status, no status shows all contacts.",
|
||||
"Possible statuses are: online, offline, away, dnd, xa, chat, available, unavailable.",
|
||||
"",
|
||||
"\"/who online\" will list contacts that are connected, i.e. online, chat, away, xa, dnd",
|
||||
"\"/who available\" will list contacts that are available for chat, i.e. online, chat.",
|
||||
"\"/who unavailable\" will list contacts that are not available for chat, i.e. offline, away, xa, dnd.",
|
||||
"online : Contacts that are connected, i.e. online, chat, away, xa, dnd",
|
||||
"available : Contacts that are available for chat, i.e. online, chat.",
|
||||
"unavailable : Contacts that are not available for chat, i.e. offline, away, xa, dnd.",
|
||||
"",
|
||||
"If in a chat room, this command shows the room roster in the room.",
|
||||
NULL } } },
|
||||
@ -339,7 +325,7 @@ static struct cmd_t main_commands[] =
|
||||
{ "/quit", "Quit Profanity.",
|
||||
{ "/quit",
|
||||
"-----",
|
||||
"Logout of any current sessions, and quit Profanity.",
|
||||
"Logout of any current session, and quit Profanity.",
|
||||
NULL } } }
|
||||
};
|
||||
|
||||
@ -352,11 +338,7 @@ static struct cmd_t setting_commands[] =
|
||||
"------------",
|
||||
"Switch the terminal bell on or off.",
|
||||
"The bell will sound when incoming messages are received.",
|
||||
"If the terminal does not support sounds, it may attempt to",
|
||||
"flash the screen instead.",
|
||||
"",
|
||||
"Config file section : [ui]",
|
||||
"Config file value : beep=true|false",
|
||||
"If the terminal does not support sounds, it may attempt to flash the screen instead.",
|
||||
NULL } } },
|
||||
|
||||
{ "/notify",
|
||||
@ -377,11 +359,6 @@ static struct cmd_t setting_commands[] =
|
||||
"Example : /notify remind 10 (remind every 10 seconds)",
|
||||
"Example : /notify remind 0 (switch off reminders)",
|
||||
"Example : /notify typing on (enable typing notifications)",
|
||||
"",
|
||||
"Config file section : [notifications]",
|
||||
"Config file value : message=on|off",
|
||||
"Config file value : typing=on|off",
|
||||
"Config file value : remind=seconds",
|
||||
NULL } } },
|
||||
|
||||
{ "/flash",
|
||||
@ -390,12 +367,8 @@ static struct cmd_t setting_commands[] =
|
||||
{ "/flash on|off",
|
||||
"-------------",
|
||||
"Make the terminal flash when incoming messages are recieved.",
|
||||
"The flash will only occur if you are not in the chat window associated",
|
||||
"with the user sending the message.",
|
||||
"The terminal must support flashing, if it doesn't it may attempt to beep.",
|
||||
"",
|
||||
"Config file section : [ui]",
|
||||
"Config file value : flash=true|false",
|
||||
"The flash will only occur if you are not in the chat window associated with the user sending the message.",
|
||||
"If the terminal doesn't support flashing, it may attempt to beep.",
|
||||
NULL } } },
|
||||
|
||||
{ "/intype",
|
||||
@ -404,9 +377,6 @@ static struct cmd_t setting_commands[] =
|
||||
{ "/intype on|off",
|
||||
"--------------",
|
||||
"Show when a contact is typing in the console, and in active message window.",
|
||||
"",
|
||||
"Config file section : [ui]",
|
||||
"Config file value : intype=true|false",
|
||||
NULL } } },
|
||||
|
||||
{ "/splash",
|
||||
@ -415,9 +385,6 @@ static struct cmd_t setting_commands[] =
|
||||
{ "/splash on|off",
|
||||
"--------------",
|
||||
"Switch on or off the ascii logo on start up.",
|
||||
"",
|
||||
"Config file section : [ui]",
|
||||
"Config file value : splash=true|false",
|
||||
NULL } } },
|
||||
|
||||
{ "/vercheck",
|
||||
@ -426,8 +393,7 @@ static struct cmd_t setting_commands[] =
|
||||
{ "/vercheck [on|off]",
|
||||
"------------------",
|
||||
"Without a parameter will check for a new release.",
|
||||
"Switching on or off will enable/disable a version check when Profanity starts,",
|
||||
"and each time the /about command is run.",
|
||||
"Switching on or off will enable/disable a version check when Profanity starts, and each time the /about command is run.",
|
||||
NULL } } },
|
||||
|
||||
{ "/titlebar",
|
||||
@ -435,10 +401,8 @@ static struct cmd_t setting_commands[] =
|
||||
{ "/titlebar property on|off", "Show various properties in the window title bar.",
|
||||
{ "/titlebar property on|off",
|
||||
"-------------------------",
|
||||
"Show various properties in the window title bar.",
|
||||
"Possible properties are 'version'.",
|
||||
"",
|
||||
"Config file section : [ui]",
|
||||
"Config file value : titlebar.version=true|false",
|
||||
NULL } } },
|
||||
|
||||
{ "/chlog",
|
||||
@ -447,9 +411,6 @@ static struct cmd_t setting_commands[] =
|
||||
{ "/chlog on|off",
|
||||
"-------------",
|
||||
"Switch chat logging on or off.",
|
||||
"",
|
||||
"Config file section : [logging]",
|
||||
"Config file value : chlog=true|false",
|
||||
NULL } } },
|
||||
|
||||
{ "/states",
|
||||
@ -458,12 +419,7 @@ static struct cmd_t setting_commands[] =
|
||||
{ "/states on|off",
|
||||
"--------------",
|
||||
"Sending of chat state notifications during chat sessions.",
|
||||
"Enabling this will send information about your activity during a chat",
|
||||
"session with somebody, such as whether you have become inactive, or",
|
||||
"have close the chat window.",
|
||||
"",
|
||||
"Config file section : [chatstates]",
|
||||
"Config file value : enabled=true|false",
|
||||
"Such as whether you have become inactive, or have close the chat window.",
|
||||
NULL } } },
|
||||
|
||||
{ "/outtype",
|
||||
@ -473,9 +429,6 @@ static struct cmd_t setting_commands[] =
|
||||
"--------------",
|
||||
"Send an indication that you are typing to the other person in chat.",
|
||||
"Chat states must be enabled for this to work, see the /states command.",
|
||||
"",
|
||||
"Config file section : [chatstates]",
|
||||
"Config file value : outtype=true|false",
|
||||
NULL } } },
|
||||
|
||||
{ "/history",
|
||||
@ -483,26 +436,17 @@ static struct cmd_t setting_commands[] =
|
||||
{ "/history on|off", "Chat history in message windows.",
|
||||
{ "/history on|off",
|
||||
"---------------",
|
||||
"Switch chat history on or off, requires chlog to be enabled.",
|
||||
"Switch chat history on or off, requires /chlog to be enabled.",
|
||||
"When history is enabled, previous messages are shown in chat windows.",
|
||||
"The last day of messages are shown, or if you have had profanity open",
|
||||
"for more than a day, messages will be shown from the day which",
|
||||
"you started profanity.",
|
||||
"",
|
||||
"Config file section : [ui]",
|
||||
"Config file value : history=true|false",
|
||||
NULL } } },
|
||||
|
||||
{ "/log",
|
||||
_cmd_set_log, parse_args, 2, 2,
|
||||
{ "/log maxsize <value>", "Manage system logging settings.",
|
||||
{ "/log maxsize <value>",
|
||||
"--------------------",
|
||||
{ "/log maxsize value", "Manage system logging settings.",
|
||||
{ "/log maxsize value",
|
||||
"------------------",
|
||||
"maxsize : When log file size exceeds this value it will be automatically",
|
||||
" rotated (file will be renamed). Default value is 1048580 (1MB)",
|
||||
"",
|
||||
"Config file section : [logging]",
|
||||
"Config file value : maxsize=bytes",
|
||||
NULL } } },
|
||||
|
||||
{ "/reconnect",
|
||||
@ -512,21 +456,15 @@ static struct cmd_t setting_commands[] =
|
||||
"--------------------",
|
||||
"Set the reconnect attempt interval in seconds for when the connection is lost.",
|
||||
"A value of 0 will switch of reconnect attempts.",
|
||||
"",
|
||||
"Config file section : [connection]",
|
||||
"Config file value : reconnect=seconds",
|
||||
NULL } } },
|
||||
|
||||
{ "/autoping",
|
||||
_cmd_set_autoping, parse_args, 1, 1,
|
||||
{ "/autoping seconds", "Server ping interval.",
|
||||
{ "/autoping seconds",
|
||||
"--------------------",
|
||||
"-----------------",
|
||||
"Set the number of seconds between server pings, so ensure connection kept alive.",
|
||||
"A value of 0 will switch off autopinging the server.",
|
||||
"",
|
||||
"Config file section : [connection]",
|
||||
"Config file value : autoping=seconds",
|
||||
NULL } } },
|
||||
|
||||
{ "/autoaway",
|
||||
@ -548,23 +486,15 @@ static struct cmd_t setting_commands[] =
|
||||
"Example: /autoaway time 30",
|
||||
"Example: /autoaway message I'm not really doing much",
|
||||
"Example: /autoaway check false",
|
||||
"",
|
||||
"Config file section : [presence]",
|
||||
"Config file value : autoaway.mode=idle|away|off",
|
||||
"Config file value : autoaway.time=value",
|
||||
"Config file value : autoaway.message=value",
|
||||
"Config file value : autoaway.check=on|off",
|
||||
NULL } } },
|
||||
|
||||
{ "/priority",
|
||||
_cmd_set_priority, parse_args, 1, 1,
|
||||
{ "/priority <value>", "Set priority for connection.",
|
||||
{ "/priority <value>",
|
||||
"--------------------",
|
||||
{ "/priority value", "Set priority for connection.",
|
||||
{ "/priority value",
|
||||
"---------------",
|
||||
"Set priority for the current session.",
|
||||
"value : Number between -128 and 127. Default value is 0.",
|
||||
"",
|
||||
"Config file section : [presence]",
|
||||
"Config file value : priority=value",
|
||||
NULL } } }
|
||||
};
|
||||
|
||||
@ -575,7 +505,7 @@ static struct cmd_t presence_commands[] =
|
||||
{ "/away [msg]", "Set status to away.",
|
||||
{ "/away [msg]",
|
||||
"-----------",
|
||||
"Set your status to \"away\" with the optional message.",
|
||||
"Set your status to 'away' with the optional message.",
|
||||
"Your current status can be found in the top right of the screen.",
|
||||
"",
|
||||
"Example : /away Gone for lunch",
|
||||
@ -586,8 +516,7 @@ static struct cmd_t presence_commands[] =
|
||||
{ "/chat [msg]", "Set status to chat (available for chat).",
|
||||
{ "/chat [msg]",
|
||||
"-----------",
|
||||
"Set your status to \"chat\", meaning \"available for chat\",",
|
||||
"with the optional message.",
|
||||
"Set your status to 'chat', meaning 'available for chat', with the optional message.",
|
||||
"Your current status can be found in the top right of the screen.",
|
||||
"",
|
||||
"Example : /chat Please talk to me!",
|
||||
@ -598,8 +527,7 @@ static struct cmd_t presence_commands[] =
|
||||
{ "/dnd [msg]", "Set status to dnd (do not disturb).",
|
||||
{ "/dnd [msg]",
|
||||
"----------",
|
||||
"Set your status to \"dnd\", meaning \"do not disturb\",",
|
||||
"with the optional message.",
|
||||
"Set your status to 'dnd', meaning 'do not disturb', with the optional message.",
|
||||
"Your current status can be found in the top right of the screen.",
|
||||
"",
|
||||
"Example : /dnd I'm in the zone",
|
||||
@ -610,7 +538,7 @@ static struct cmd_t presence_commands[] =
|
||||
{ "/online [msg]", "Set status to online.",
|
||||
{ "/online [msg]",
|
||||
"-------------",
|
||||
"Set your status to \"online\" with the optional message.",
|
||||
"Set your status to 'online' with the optional message.",
|
||||
"Your current status can be found in the top right of the screen.",
|
||||
"",
|
||||
"Example : /online Up the Irons!",
|
||||
@ -621,8 +549,7 @@ static struct cmd_t presence_commands[] =
|
||||
{ "/xa [msg]", "Set status to xa (extended away).",
|
||||
{ "/xa [msg]",
|
||||
"---------",
|
||||
"Set your status to \"xa\", meaning \"extended away\",",
|
||||
"with the optional message.",
|
||||
"Set your status to 'xa', meaning 'extended away', with the optional message.",
|
||||
"Your current status can be found in the top right of the screen.",
|
||||
"",
|
||||
"Example : /xa This meeting is going to be a long one",
|
||||
@ -1145,15 +1072,6 @@ _cmd_help(gchar **args, struct cmd_help_t help)
|
||||
}
|
||||
}
|
||||
cons_show_word("\n");
|
||||
cons_show("Settings commands:");
|
||||
cons_show_time();
|
||||
for (i = 0; i < ARRAY_SIZE(setting_commands); i++) {
|
||||
cons_show_word( (setting_commands+i)->cmd );
|
||||
if (i < ARRAY_SIZE(setting_commands) - 1) {
|
||||
cons_show_word(", ");
|
||||
}
|
||||
}
|
||||
cons_show_word("\n");
|
||||
cons_show("Presence commands:");
|
||||
cons_show_time();
|
||||
for (i = 0; i < ARRAY_SIZE(presence_commands); i++) {
|
||||
@ -1163,6 +1081,15 @@ _cmd_help(gchar **args, struct cmd_help_t help)
|
||||
}
|
||||
}
|
||||
cons_show_word("\n");
|
||||
cons_show("Settings commands:");
|
||||
cons_show_time();
|
||||
for (i = 0; i < ARRAY_SIZE(setting_commands); i++) {
|
||||
cons_show_word( (setting_commands+i)->cmd );
|
||||
if (i < ARRAY_SIZE(setting_commands) - 1) {
|
||||
cons_show_word(", ");
|
||||
}
|
||||
}
|
||||
cons_show_word("\n");
|
||||
} else if (strcmp(args[0], "basic") == 0) {
|
||||
cons_basic_help();
|
||||
} else if (strcmp(args[0], "presence") == 0) {
|
||||
|
@ -1392,7 +1392,7 @@ cons_settings_help(void)
|
||||
GSList *settings_helpers = cmd_get_settings_help();
|
||||
while (settings_helpers != NULL) {
|
||||
struct cmd_help_t *help = (struct cmd_help_t *)settings_helpers->data;
|
||||
cons_show("%-25s: %s", help->usage, help->short_help);
|
||||
cons_show("%-27s: %s", help->usage, help->short_help);
|
||||
settings_helpers = g_slist_next(settings_helpers);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user