[7d4fbcd] | 1 | #include "owl.h" |
---|
| 2 | #include <string.h> |
---|
| 3 | |
---|
[c79a047] | 4 | void owl_help(void) |
---|
[15283bb] | 5 | { |
---|
[ca54fd6] | 6 | const owl_variable *v; |
---|
[7d4fbcd] | 7 | owl_fmtext fm; |
---|
[e19eb97] | 8 | const char *varname; |
---|
[ce68f23] | 9 | GPtrArray *varnames; |
---|
| 10 | int i; |
---|
[7d4fbcd] | 11 | |
---|
| 12 | owl_fmtext_init_null(&fm); |
---|
| 13 | owl_fmtext_append_bold |
---|
[6794f72] | 14 | (&fm, |
---|
| 15 | "OWL HELP\n\n"); |
---|
[7d4fbcd] | 16 | |
---|
| 17 | owl_fmtext_append_normal |
---|
[6794f72] | 18 | (&fm, |
---|
[799b60e] | 19 | " If you're new to BarnOwl, the first thing you should type is\n\n" |
---|
| 20 | " :show quickstart\n\n" |
---|
[6794f72] | 21 | " For help on a specific command use 'help <command>'\n" |
---|
| 22 | " For information on advanced keys, use 'show keymaps'.\n" |
---|
| 23 | " For information on advanced commands, use 'show commands'.\n" |
---|
| 24 | " For information on variables, use 'show variables'.\n\n"); |
---|
[7d4fbcd] | 25 | |
---|
| 26 | owl_fmtext_append_bold |
---|
[6794f72] | 27 | (&fm, |
---|
| 28 | " Basic Keys:\n" |
---|
| 29 | ); |
---|
[7d4fbcd] | 30 | owl_fmtext_append_normal |
---|
[6794f72] | 31 | (&fm, |
---|
| 32 | " n Move to next non-deleted message\n" |
---|
| 33 | " p Move to previous non-deleted message\n" |
---|
| 34 | " C-n , down Move to next message\n" |
---|
| 35 | " C-p , up Move to previous message\n" |
---|
| 36 | " < , > Move to first, last message\n" |
---|
| 37 | " right , left Scroll screen left or right\n" |
---|
| 38 | " C-v Page down\n" |
---|
| 39 | " M-v Page up\n" |
---|
| 40 | " i Print more information about a message\n" |
---|
| 41 | " P Move to the next personal message\n" |
---|
[ec53338] | 42 | " M-P Move to the previous personal message\n" |
---|
[c38bfe0] | 43 | " C-space Move the mark (asterisk) to the current message\n" |
---|
| 44 | " C-x C-x Move the mark to the current message while moving to previous mark\n" |
---|
[6794f72] | 45 | "\n" |
---|
| 46 | " d Mark message for deletion\n" |
---|
| 47 | " u Undelete a message marked for deletion\n" |
---|
| 48 | " x Expunge deleted messages\n" |
---|
[15283bb] | 49 | " X Expunge deleted messages and switch to home view\n" |
---|
[6794f72] | 50 | " T Mark all 'trash' messages for deletion\n" |
---|
| 51 | " M-D Mark all messages in current view for deletion\n" |
---|
| 52 | " M-u Unmark all messages in the current view for deletion\n" |
---|
| 53 | "\n" |
---|
| 54 | " z Start a zwrite command\n" |
---|
[15283bb] | 55 | " a Start an aimwrite command\n" |
---|
[6794f72] | 56 | " r Reply to the current message\n" |
---|
| 57 | " R Reply to sender\n" |
---|
| 58 | " C-r Reply but allow editing of reply line\n" |
---|
| 59 | "\n" |
---|
[15283bb] | 60 | " M-n View zephyrs in selected conversation\n" |
---|
[e6d989f] | 61 | " M-N View zephyrs in selected conversation of instance\n" |
---|
[0398d55] | 62 | " M-p View only personal zephyrs\n" |
---|
[65fc0900] | 63 | " V Change to back to home view ('all' by default)\n" |
---|
[6794f72] | 64 | " v Start a view command\n" |
---|
[3895e23] | 65 | " ! Invert the current view\n" |
---|
[6794f72] | 66 | "\n" |
---|
[15283bb] | 67 | " l Print a zephyr/AIM buddy listing\n" |
---|
[6794f72] | 68 | " A Toggle zaway\n" |
---|
[15283bb] | 69 | " o Toggle one-line display mode\n" |
---|
| 70 | " w Open a URL in the current message\n" |
---|
[6794f72] | 71 | " C-l Refresh the screen\n" |
---|
[15283bb] | 72 | " C-z Suspend Owl\n" |
---|
[6794f72] | 73 | " h Print this help message\n" |
---|
[bde7714] | 74 | " : , M-x Enter command mode\n" |
---|
[55faab7] | 75 | "\n" |
---|
| 76 | " / Foward search\n" |
---|
| 77 | " ? Reverse search\n" |
---|
[6794f72] | 78 | "\n\n" |
---|
| 79 | ); |
---|
[7d4fbcd] | 80 | owl_fmtext_append_bold |
---|
[6794f72] | 81 | (&fm, |
---|
| 82 | " Basic Commands:\n" |
---|
| 83 | ); |
---|
[7d4fbcd] | 84 | owl_fmtext_append_normal |
---|
[6794f72] | 85 | (&fm, |
---|
| 86 | " quit, exit Exit owl\n" |
---|
| 87 | " help Get help about commands\n" |
---|
| 88 | " show Show information about owl (see detailed help)\n" |
---|
| 89 | "\n" |
---|
| 90 | " zwrite Send a zephyr\n" |
---|
[15283bb] | 91 | " aimlogin Login to AIM\n" |
---|
| 92 | " aimwrite Send an AIM message\n" |
---|
[6794f72] | 93 | "\n" |
---|
[15283bb] | 94 | " addbuddy Add a zephyr or AIM buddy\n" |
---|
| 95 | " zaway Turn zaway on or off, or set the message\n" |
---|
| 96 | " zlocate Locate a user\n" |
---|
[6794f72] | 97 | " subscribe Subscribe to a zephyr class or instance\n" |
---|
| 98 | " unsubscribe Unsubscribe to a zephyr class or instance\n" |
---|
[15283bb] | 99 | " blist Print a list of zephyr and AIM buddies logged in\n" |
---|
| 100 | " search Search for a text string\n" |
---|
| 101 | "\n" |
---|
| 102 | " set Set a variable (see list below)\n" |
---|
| 103 | " print Print a variable's value (variables listed below)\n" |
---|
| 104 | " startup Set a command to be run at every Owl startup\n" |
---|
| 105 | " unstartup Remove a command to be run at every Owl startup\n" |
---|
| 106 | "\n" |
---|
[6794f72] | 107 | " getsubs Print a list of current subscriptions\n" |
---|
[15283bb] | 108 | " unsuball Unsubscribe from all zephyr classes\n" |
---|
| 109 | " load-subs Load zephyr subscriptions from a file\n" |
---|
| 110 | " zpunt Supress messages from a zephyr triplet\n" |
---|
| 111 | " zlog Send a login or logout notification\n" |
---|
| 112 | " zlist Print a list of zephyr buddies logged in\n" |
---|
| 113 | " alist Print a list of AIM buddies logged in\n" |
---|
[6794f72] | 114 | " info Print detailed information about the current message\n" |
---|
| 115 | " filter Create a message filter\n" |
---|
| 116 | " view View messages matching a filter\n" |
---|
| 117 | " viewuser View messages to or from a particular user\n" |
---|
| 118 | " viewclass View messages to a particular class\n" |
---|
| 119 | " expunge Expunge messages marked for deletion\n" |
---|
[15283bb] | 120 | " bindkey Create a new key binding\n" |
---|
| 121 | " alias Create a command alias\n" |
---|
[ec53338] | 122 | " dump Dump messagelist as text to a file\n" |
---|
[6794f72] | 123 | "\n" |
---|
| 124 | " about Print information about owl\n" |
---|
| 125 | " status Print status information about the running owl\n" |
---|
| 126 | " version Print the version number of owl\n" |
---|
| 127 | "\n"); |
---|
[7d4fbcd] | 128 | |
---|
| 129 | /* help for variables */ |
---|
| 130 | owl_fmtext_append_bold(&fm, |
---|
[6794f72] | 131 | "Variables:\n"); |
---|
[ce68f23] | 132 | varnames = owl_variable_dict_get_names(owl_global_get_vardict(&g)); |
---|
| 133 | for (i = 0; i < varnames->len; i++) { |
---|
| 134 | varname = varnames->pdata[i]; |
---|
[7d4fbcd] | 135 | if (varname && varname[0]!='_') { |
---|
[ca54fd6] | 136 | v = owl_variable_get_var(owl_global_get_vardict(&g), varname); |
---|
| 137 | owl_variable_describe(v, &fm); |
---|
[7d4fbcd] | 138 | } |
---|
| 139 | } |
---|
[ce68f23] | 140 | owl_ptr_array_free(varnames, g_free); |
---|
[7d4fbcd] | 141 | |
---|
| 142 | owl_fmtext_append_normal(&fm, "\n"); |
---|
| 143 | |
---|
| 144 | owl_function_popless_fmtext(&fm); |
---|
| 145 | |
---|
[7ab0020] | 146 | owl_fmtext_cleanup(&fm); |
---|
[7d4fbcd] | 147 | } |
---|