Extend `if' conditionals ('[01]' and '$COND( [!=]= VAL)?')
[s-mailx.git] / cmd_tab.h
bloba28605b9f9e6bc6bff8d7c3ed66781ddb5d2e25d
1 /*@ S-nail - a mail user agent derived from Berkeley Mail.
2 *@ This header is included by ./lex.c and defines the command array content.
4 * Copyright (c) 2000-2004 Gunnar Ritter, Freiburg i. Br., Germany.
5 * Copyright (c) 2012 - 2013 Steffen "Daode" Nurpmeso <sdaoden@users.sf.net>.
6 */
7 /*
8 * Copyright (c) 1980, 1993
9 * The Regents of the University of California. All rights reserved.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed by the University of
22 * California, Berkeley and its contributors.
23 * 4. Neither the name of the University nor the names of its contributors
24 * may be used to endorse or promote products derived from this software
25 * without specific prior written permission.
27 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
40 #ifdef HAVE_DOCSTRINGS
41 # define DS(ID,S) , ID, S
42 #else
43 # define DS(ID,S)
44 #endif
46 { "next", next, (A | NDMLIST), 0, MMNDEL
47 DS(355, "Goes to the next message (-list) and prints it") },
48 { "alias", group, (M | RAWLIST), 0, 1000
49 DS(304, "Show all or the specified alias(es), or (re)define one") },
50 { "print", type, (A | MSGLIST), 0, MMNDEL
51 DS(361, "Type each message of <message-list> on the terminal") },
52 { "type", type, (A | MSGLIST), 0, MMNDEL
53 DS(361, "Type each message of <message-list> on the terminal") },
54 { "Type", Type, (A | MSGLIST), 0, MMNDEL
55 DS(360, "Like \"print\", but prints all headers and parts") },
56 { "Print", Type, (A | MSGLIST), 0, MMNDEL
57 DS(360, "Like \"print\", but prints all headers and parts") },
58 { "visual", visual, (A | I | MSGLIST), 0, MMNORM
59 DS(326, "Edit <message-list>") },
60 { "top", top, (A | MSGLIST), 0, MMNDEL
61 DS(385, "Print top few lines of <message-list>") },
62 { "touch", stouch, (A | W | MSGLIST), 0, MMNDEL
63 DS(386, "Mark <message-list> for saving in *mbox*") },
64 { "preserve", preserve, (A | W | MSGLIST), 0, MMNDEL
65 DS(344, "Save <message-list> in system mailbox instead of *mbox*") },
66 { "delete", delete, (A | W | P | MSGLIST), 0, MMNDEL
67 DS(320, "Delete <message-list>") },
68 { "dp", deltype, (A | W | MSGLIST), 0, MMNDEL
69 DS(323, "Delete the current message, then print the next") },
70 { "dt", deltype, (A | W | MSGLIST), 0, MMNDEL
71 DS(323, "Delete the current message, then print the next") },
72 { "undelete", undeletecmd, (A | P | MSGLIST), MDELETED,MMNDEL
73 DS(392, "Un\"delete\" <message-list>") },
74 { "unset", unset, (M | RAWLIST), 1, 1000
75 DS(402, "Unset <option-list>") },
76 { "mail", csendmail, (R | M | I | STRLIST), 0, 0
77 DS(351, "Compose mail; recipients may be given as arguments") },
78 { "Mail", cSendmail, (R | M | I | STRLIST), 0, 0
79 DS(350, "Like \"mail\", but derive filename from first recipient") },
80 { "mbox", mboxit, (A | W | MSGLIST), 0, 0
81 DS(352, "Indicate that <message-list> is to be stored in *mbox*") },
82 { "more", more, (A | MSGLIST), 0, MMNDEL
83 DS(410, "Like \"type\"/\"print\", put print \\f between messages") },
84 { "page", more, (A | MSGLIST), 0, MMNDEL
85 DS(410, "Like \"type\"/\"print\", put print \\f between messages") },
86 { "More", More, (A | MSGLIST), 0, MMNDEL
87 DS(411, "Like \"Type\"/\"Print\", put print \\f between messages") },
88 { "Page", More, (A | MSGLIST), 0, MMNDEL
89 DS(411, "Like \"Type\"/\"Print\", put print \\f between messages") },
90 { "unread", unread, (A | MSGLIST), 0, MMNDEL
91 DS(356, "Mark <message-list> as not being read") },
92 { "Unread", unread, (A | MSGLIST), 0, MMNDEL
93 DS(356, "Mark <message-list> as not being read") },
94 { "new", unread, (A | MSGLIST), 0, MMNDEL
95 DS(356, "Mark <message-list> as not being read") },
96 { "New", unread, (A | MSGLIST), 0, MMNDEL
97 DS(356, "Mark <message-list> as not being read") },
98 { "!", shell, (I | STRLIST), 0, 0
99 DS(412, "Execute <shell-command>") },
100 { "copy", copycmd, (A | M | STRLIST), 0, 0
101 DS(314, "Copy <message-list>, but don't mark them for deletion") },
102 { "Copy", Copycmd, (A | M | STRLIST), 0, 0
103 DS(315, "Like \"copy\", but derive filename from first sender") },
104 { "chdir", c_chdir, (M | RAWLIST), 0, 1
105 DS(309, "Change CWD to the specified/the login directory") },
106 { "cd", c_chdir, (M | RAWLIST), 0, 1
107 DS(309, "Change CWD to the specified/the login directory") },
108 { "save", save, (A | STRLIST), 0, 0
109 DS(371, "Append <message-list> to <file>") },
110 { "Save", Save, (A | STRLIST), 0, 0
111 DS(372, "Like \"save\", but derive filename from first sender") },
112 { "source", csource, (M | RAWLIST), 1, 1
113 DS(383, "Read commands from <file>") },
114 { "set", set, (M | RAWLIST), 0, 1000
115 DS(376, "Print all variables, or set variables to argument(s)") },
116 { "shell", dosh, (I | NOLIST), 0, 0
117 DS(378, "Invoke an interactive shell") },
118 { "unalias", ungroup, (M | RAWLIST), 0, 1000
119 DS(387, "Un\"alias\" <name-list>") },
120 { "write", cwrite, (A | STRLIST), 0, 0
121 DS(406, "Write (append) to <file>") },
122 { "from", from, (A | MSGLIST), 0, MMNORM
123 DS(338, "Show message headers of <message-list>") },
124 { "file", cfile, (T | M | RAWLIST), 0, 1
125 DS(329, "Switch to new or show the current mail file or folder") },
126 { "followup", followup, (A | R | I | MSGLIST), 0, MMNDEL
127 DS(333, "Like \"respond\", but derive filename from first sender") },
128 { "followupall", followupall, (A | R | I | MSGLIST), 0, MMNDEL
129 DS(334, "Like \"respond\", but derive filename from first sender") },
130 { "followupsender", followupsender, (A | R | I | MSGLIST), 0, MMNDEL
131 DS(335, "Like \"Followup\", but always respond to the sender only") },
132 { "folder", cfile, (T | M | RAWLIST), 0, 1
133 DS(329, "Switch to new or show the current mail file or folder") },
134 { "folders", folders, (T | M | RAWLIST), 0, 1
135 DS(332, "List folders (below given folder)") },
136 { "z", scroll, (A | M | STRLIST), 0, 0
137 DS(407, "Scroll to next/previous window of headers") },
138 { "Z", Scroll, (A | M | STRLIST), 0, 0
139 DS(408, "Like \"z\", but continues to the next flagged message") },
140 { "headers", headers, (A | MSGLIST), 0, MMNDEL
141 DS(342, "Show the current(/last/next) 18-message group of headers") },
142 { "help", help, (M | RAWLIST), 0, 1
143 DS(343, "Show command help (for the given one)") },
144 { "?", help, (M | RAWLIST), 0, 1
145 DS(343, "Show command help (for the given one)") },
146 { "=", pdot, (A | NOLIST), 0, 0
147 DS(409, "Show current message number") },
148 { "Reply", Respond, (A | R | I | MSGLIST), 0, MMNDEL
149 DS(368, "Reply to originator, exclusively") },
150 { "Respond", Respond, (A | R | I | MSGLIST), 0, MMNDEL
151 DS(368, "Reply to originator, exclusively") },
152 { "Followup", Followup, (A | R | I | MSGLIST), 0, MMNDEL
153 DS(332, "Like \"Respond\", but derive filename from first sender") },
154 { "reply", respond, (A | R | I | MSGLIST), 0, MMNDEL
155 DS(369, "Reply to originator and recipients of <message-list>") },
156 { "replyall", respondall, (A | R | I | MSGLIST), 0, MMNDEL
157 DS(369, "Reply to originator and recipients of <message-list>") },
158 { "replysender", respondsender, (A | R | I | MSGLIST), 0, MMNDEL
159 DS(368, "Reply to originator, exclusively") },
160 { "respond", respond, (A | R | I | MSGLIST), 0, MMNDEL
161 DS(369, "Reply to originators and recipients of <message-list>") },
162 { "respondall", respondall, (A | R | I | MSGLIST), 0, MMNDEL
163 DS(369, "Reply to originators and recipients of <message-list>") },
164 { "respondsender", respondsender, (A | R | I | MSGLIST),0, MMNDEL
165 DS(368, "Reply to originator, exclusively") },
166 { "Resend", Resendcmd, (A | R | STRLIST), 0, MMNDEL
167 DS(365, "Like \"resend\", but don't add Resent-* headers") },
168 { "Redirect", Resendcmd, (A | R | STRLIST), 0, MMNDEL
169 DS(365, "Like \"resend\", but don't add Resent-* headers") },
170 { "resend", resendcmd, (A | R | STRLIST), 0, MMNDEL
171 DS(364, "Resend <message-list> to <user>, add Resent-* headers") },
172 { "redirect", resendcmd, (A | R | STRLIST), 0, MMNDEL
173 DS(364, "Resend <message-list> to <user>, add Resent-* headers") },
174 { "Forward", Forwardcmd, (A | R | STRLIST), 0, MMNDEL
175 DS(337, "Like \"forward\", but derive filename from <address>") },
176 { "Fwd", Forwardcmd, (A | R | STRLIST), 0, MMNDEL
177 DS(337, "Like \"forward\", but derive filename from <address>") },
178 { "forward", forwardcmd, (A | R | STRLIST), 0, MMNDEL
179 DS(336, "Forward <message> to <address>") },
180 { "fwd", forwardcmd, (A | R | STRLIST), 0, MMNDEL
181 DS(336, "Forward <message> to <address>") },
182 { "edit", editor, (A | I | MSGLIST), 0, MMNORM
183 DS(326, "Edit <message-list>") },
184 { "echo", echo, (M | ECHOLIST), 0, 1000
185 DS(325, "Echo given arguments") },
186 { "quit", quitcmd, NOLIST, 0, 0
187 DS(363, "Terminate session, saving messages as necessary") },
188 { "list", &_pcmdlist, (M | NOLIST), 0, 0
189 DS(349, "List all available commands") },
190 { "xit", rexit, (M | NOLIST), 0, 0
191 DS(328, "Immediate return to the shell without saving") },
192 { "exit", rexit, (M | NOLIST), 0, 0
193 DS(328, "Immediate return to the shell without saving") },
194 { "pipe", pipecmd, (A | STRLIST), 0, MMNDEL
195 DS(359, "Pipe <message-list> to <command>") },
196 { " | ", pipecmd, (A | STRLIST), 0, MMNDEL
197 DS(359, "Pipe <message-list> to <command>") },
198 { "Pipe", Pipecmd, (A | STRLIST), 0, MMNDEL
199 DS(358, "Like \"pipe\", but pipes all headers and parts") },
200 { "size", messize, (A | MSGLIST), 0, MMNDEL
201 DS(381, "Show size in characters for <message-list>") },
202 { "hold", preserve, (A | W | MSGLIST), 0, MMNDEL
203 DS(344, "Save <message-list> in system mailbox instead of *mbox*") },
204 { "if", &c_if, (F | M | RAWLIST), 1, 3
205 DS(327, "Part of the if .. then .. endif statement") },
206 { "else", &c_else, (F | M | RAWLIST), 0, 0
207 DS(327, "Part of the if .. then .. endif statement") },
208 { "endif", &c_endif, (F | M | RAWLIST), 0, 0
209 DS(327, "Part of the if .. then .. endif statement") },
210 { "alternates", alternates, (M | RAWLIST), 0, 1000
211 DS(305, "Show or define an alternate list for the invoking user") },
212 { "ignore", igfield, (M | RAWLIST), 0, 1000
213 DS(321, "Add header fields to ignored LIST), or show that list") },
214 { "discard", igfield, (M | RAWLIST), 0, 1000
215 DS(321, "Add header fields to ignored LIST), or show that list") },
216 { "retain", retfield, (M | RAWLIST), 0, 1000
217 DS(370, "Add header fields to retained LIST), or show that list") },
218 { "saveignore", saveigfield, (M | RAWLIST), 0, 1000
219 DS(373, "Is to \"save\" what \"ignore\" is to \"type\"/\"print\"") },
220 { "savediscard",saveigfield, (M | RAWLIST), 0, 1000
221 DS(373, "Is to \"save\" what \"ignore\" is to \"type\"/\"print\"") },
222 { "saveretain", saveretfield, (M | RAWLIST), 0, 1000
223 DS(374, "Is to \"save\" what \"retain\" is to \"type\"/\"print\"") },
224 { "unignore", unignore, (M | RAWLIST), 0, 1000
225 DS(396, "Un\"ignore\" <header-fields>") },
226 { "unretain", unretain, (M | RAWLIST), 0, 1000
227 DS(399, "Un\"retain\" <header-fields>") },
228 { "unsaveignore", unsaveignore, (M | RAWLIST), 0, 1000
229 DS(400, "Un\"saveignore\" <header-fields>") },
230 { "unsaveretain", unsaveretain, (M | RAWLIST), 0, 1000
231 DS(401, "Un\"saveretain\" <header-fields>") },
232 { "inc", newmail, (A | T | NOLIST), 0, 0
233 DS(346, "Check for new mail in current folder") },
234 { "newmail", newmail, (A | T | NOLIST), 0, 0
235 DS(346, "Check for new mail in current folder") },
236 { "shortcut", shortcut, (M | RAWLIST), 0, 1000
237 DS(379, "Define a <shortcut> and <expansion>, or list shortcuts") },
238 { "unshortcut", unshortcut, (M | RAWLIST), 0, 1000
239 DS(403, "Delete <shortcut-list>") },
240 { "imap", imap_imap, (A | STRLIST), 0, 1000
241 DS(345, "Send command strings directly to the IMAP server") },
242 { "account", c_account, (M | RAWLIST), 0, 1000
243 DS(303, "Creates, selects or lists an email account") },
244 { "thread", thread, (A | MSGLIST), 0, 0
245 DS(384, "Create threaded view of current \"folder\"") },
246 { "unthread", unthread, (A | MSGLIST), 0, 0
247 DS(404, "Disable sorted or threaded mode") },
248 { "online", cconnect, (A | NOLIST), 0, 0
249 DS(314, "If disconnected, connect to IMAP mailbox") },
250 { "connect", cconnect, (A | NOLIST), 0, 0
251 DS(314, "If disconnected, connect to IMAP mailbox") },
252 { "disconnect", cdisconnect, (A | NDMLIST), 0, 0
253 DS(322, "If connected, disconnect from IMAP mailbox") },
254 { "sort", sort, (A | RAWLIST), 0, 1
255 DS(382, "Change sorting criteria (and addressing modes)") },
256 { "unsort", unthread, (A | MSGLIST), 0, 0
257 DS(404, "Disable sorted or threaded mode") },
258 { "cache", ccache, (A | MSGLIST), 0, 0
259 DS(307, "Read specified <message list> into the IMAP cache") },
260 { "flag", cflag, (A | M | MSGLIST), 0, 0
261 DS(330, "(Un)Flag <message-list> (for special attention)") },
262 { "unflag", cunflag, (A | M | MSGLIST), 0, 0
263 DS(330, "(Un)Flag <message-list> (for special attention)") },
264 { "answered", canswered, (A | M | MSGLIST), 0, 0
265 DS(306, "Mark the given <message list> as \"answered\"") },
266 { "unanswered", cunanswered, (A | M | MSGLIST), 0, 0
267 DS(388, "Un\"answered\" <message-list>") },
268 { "draft", cdraft, (A | M | MSGLIST), 0, 0
269 DS(324, "Mark <message-list> as draft") },
270 { "undraft", cundraft, (A | M | MSGLIST), 0, 0
271 DS(389, "Un\"draft\" <message-list>") },
272 { "define", &c_define, (M | RAWLIST), 0, 2
273 DS(319, "Define a macro") },
274 { "defines", &c_defines, (M | RAWLIST), 0, 0
275 DS(320, "Show all defined macros including their content") },
276 { "undef", &c_undef, (M | RAWLIST), 0, 1000
277 DS(391, "Un\"define\" all <macros>") },
278 { "call", &c_call, (M | RAWLIST), 0, 1
279 DS(308, "Call a macro") },
280 { "~", &c_call, (M | RAWLIST), 0, 1
281 DS(308, "Call a macro") },
282 { "move", cmove, (A | M | STRLIST), 0, 0
283 DS(353, "Like \"copy\", but mark messages for deletion") },
284 { "mv", cmove, (A | M | STRLIST), 0, 0
285 DS(353, "Like \"copy\", but mark messages for deletion") },
286 { "Move", cMove, (A | M | STRLIST), 0, 0
287 DS(354, "Like \"move\", but derive filename from first sender") },
288 { "Mv", cMove, (A | M | STRLIST), 0, 0
289 DS(354, "Like \"move\", but derive filename from first sender") },
290 { "noop", cnoop, (A | M | RAWLIST), 0, 0
291 DS(357, "NOOP command if IMAP or POP folder; else noop") },
292 { "collapse", ccollapse, (A | MSGLIST), 0, 0
293 DS(312, "Collapse thread views for <message-list>") },
294 { "uncollapse", cuncollapse, (A | MSGLIST), 0, 0
295 DS(390, "Uncollapse <message-list> if in threaded view") },
296 { "verify", cverify, (A | MSGLIST), 0, 0
297 DS(405, "Verify <message-list>") },
298 { "decrypt", cdecrypt, (A | M | STRLIST), 0, 0
299 DS(316, "Like \"copy\", but decrypt first, if encrypted") },
300 { "Decrypt", cDecrypt, (A | M | STRLIST), 0, 0
301 DS(317, "Like \"decrypt\", but derive filename from first sender") },
302 { "certsave", ccertsave, (A | STRLIST), 0, 0
303 DS(310, "Save S/MIME certificates of <message-list> to <file>") },
304 { "rename", crename, (M | RAWLIST), 0, 2
305 DS(367, "Rename <existing-folder> to <new-folder>") },
306 { "remove", cremove, (M | RAWLIST), 0, 1000
307 DS(366, "Remove the named folders") },
308 { "show", show, (A | MSGLIST), 0, MMNDEL
309 DS(380, "Like \"print\", but show raw message content") },
310 { "Show", show, (A | MSGLIST), 0, MMNDEL
311 DS(380, "Like \"print\", but show raw message content") },
312 { "seen", seen, (A | M | MSGLIST), 0, MMNDEL
313 DS(377, "Mark <message-list> as seen") },
314 { "Seen", seen, (A | M | MSGLIST), 0, MMNDEL
315 DS(377, "Mark <message-list> as seen") },
316 { "fwdignore", fwdigfield, (M | RAWLIST), 0, 1000
317 DS(339, "Which header fields are to be ignored with \"forward\"") },
318 { "fwddiscard", fwdigfield, (M | RAWLIST), 0, 1000
319 DS(339, "Which header fields are to be ignored with \"forward\"") },
320 { "fwdretain", fwdretfield, (M | RAWLIST), 0, 1000
321 DS(340, "Which header fields have to be retained with \"forward\"") },
322 { "unfwdignore", unfwdignore, (M | RAWLIST), 0, 1000
323 DS(393, "Un\"fwdignore\" <header-fields>") },
324 { "unfwdretain", unfwdretain, (M | RAWLIST), 0, 1000
325 DS(394, "Un\"fwdretain\" <header-fields>") },
326 { "mimetypes", &c_mimetypes, (M | RAWLIST), 0, 1000
327 DS(418, "Either <show> (default) or <clear> the mime.types cache") },
328 { "spamrate", cspam_rate, (A | M | R | MSGLIST), 0, 0
329 DS(419, "Rate <message-list> via the spam detector") },
330 { "spamham", cspam_ham, (A | M | R | MSGLIST), 0, 0
331 DS(420, "Teach the spam detector that <message-list> is ham") },
332 { "spamspam", cspam_spam, (A | M | R | MSGLIST), 0, 0
333 DS(421, "Teach the spam detector that <message-list> is spam") },
334 { "spamforget", cspam_forget, (A | M | R | MSGLIST), 0, 0
335 DS(422, "Force the spam detector to \"unlearn\" <message-list>") },
336 { "spamset", cspam_set, (A | M | MSGLIST), 0, 0
337 DS(423, "Set the spam flag for each message in <message-list>") },
338 { "spamclear", cspam_clear, (A | M | MSGLIST), 0, 0
339 DS(424, "Clear the spam flag for each message in <message-list>") },
340 { "ghost", &_ghost, (M | RAWLIST), 0, 2
341 DS(425, "Define a <ghost> of <command>, or list all ghosts") },
342 { "unghost", &_unghost, (M | RAWLIST), 1, 1000
343 DS(426, "Delete <ghost-list>") },
344 { "localopts", &c_localopts, (M | RAWLIST), 1, 1
345 DS(427, "Inside `define' / `account': insulate modifications? <0> / <1>")},
346 { "cwd", &c_cwd, (M | NOLIST), 0, 0
347 DS(428, "Print current working directory (CWD)") },
348 { "pwd", &c_cwd, (M | NOLIST), 0, 0
349 DS(428, "Print current working directory (CWD)") },
350 { "var-inspect", &c_var_inspect, (M | RAWLIST), 1, 1000
351 DS(430, "Print some informations on the given <variables>") },
352 { "features", &_features, (M | NOLIST), 0, 0
353 DS(429, "Show features that are compiled into the MUA") },
354 { "version", &_version, (M | NOLIST), 0, 0
355 DS(413, "Print the MUA version") },
356 #ifdef HAVE_DEBUG
357 { "core", core, (M | NOLIST), 0, 0
358 DS(414, "Produce a core dump (ouch!)") },
359 { "clobber", clobber, (M | RAWLIST), 0, 1
360 DS(415, "Globber <number> 512 byte blocks on the stack") },
361 { "sstats", &c_sstats, (M | NOLIST), 0, 0
362 DS(416, "Print statistics about the auto-reclaimed string store") },
363 { "smemtrace", smemtrace, (M | NOLIST), 0, 0
364 DS(417, "Trace current memory usage afap") },
365 #endif
366 { NULL, NULL, 0, 0, 0 DS(0, "") }
368 /* vim:set fenc=utf-8:s-it-mode */