18 |
#include "guimb.h" |
#include "guimb.h" |
19 |
#include "getopt.h" |
#include "getopt.h" |
20 |
|
|
21 |
static char short_options[] = "de:f:g:hM:m:s:u::v{"; |
static char short_options[] = "c:de:f:g:hM:m:s:u::v{"; |
22 |
static struct option long_options[] = { |
static struct option long_options[] = { |
23 |
|
{"code", required_argument, 0, 'c'}, |
24 |
{"debug", no_argument, 0, 'd'}, |
{"debug", no_argument, 0, 'd'}, |
25 |
{"expression", required_argument, 0, 'e'}, |
{"expression", required_argument, 0, 'e'}, |
26 |
{"file", required_argument, 0, 'f'}, |
{"file", required_argument, 0, 'f'}, |
27 |
{"help", no_argument, 0, 'h'}, |
{"help", no_argument, 0, 'h'}, |
28 |
{"guile-command", required_argument, 0, 'g'}, |
{"guile-arg", required_argument, 0, 'g'}, |
29 |
{"maildir", required_argument, 0, 'm'}, |
{"maildir", required_argument, 0, 'm'}, |
30 |
{"mailbox", required_argument, 0, 'M'}, |
{"mailbox", required_argument, 0, 'M'}, |
31 |
{"source", required_argument, 0, 's'}, |
{"source", required_argument, 0, 's'}, |
80 |
!= -1) |
!= -1) |
81 |
switch (c) |
switch (c) |
82 |
{ |
{ |
83 |
|
case 'c': |
84 |
|
program_expr = optarg; |
85 |
|
stop = 1; |
86 |
|
break; |
87 |
case 'd': |
case 'd': |
88 |
debug_guile = 1; |
debug_guile = 1; |
89 |
break; |
break; |
230 |
"Usage: guimb [OPTIONS] [-{ SCRIPT-OPTIONS -}] [MBOX ...]\n" |
"Usage: guimb [OPTIONS] [-{ SCRIPT-OPTIONS -}] [MBOX ...]\n" |
231 |
"Process the contents of the specified mailboxes using a Scheme program\n" |
"Process the contents of the specified mailboxes using a Scheme program\n" |
232 |
"or expression.\n" |
"or expression.\n" |
233 |
"Options are:\n" |
"Options are:\n\n" |
234 |
|
" -c, --code EXPR Execute given scheme expression.\n" |
235 |
|
" -s, --source PROGFILE Load Scheme source code from PROGFILE, and exit\n" |
236 |
|
"\nThe above switches stop argument processing, and pass all\n" |
237 |
|
"remaining arguments as the value of (command-line).\n" |
238 |
|
"\n" |
239 |
" -d, --debug Start with debugging evaluator and backtraces.\n" |
" -d, --debug Start with debugging evaluator and backtraces.\n" |
240 |
" -e, --expression EXPR Execute scheme expression.\n" |
" -e, --expression EXPR Execute scheme expression.\n" |
241 |
" -f, --file PROGFILE Read program from PROGFILE.\n" |
" -f, --file PROGFILE Read program from PROGFILE.\n" |
242 |
" -g, --guile-command ARG Append ARG to the command line passed to scheme\n" |
" -g, --guile-arg ARG Append ARG to the command line passed to scheme\n" |
243 |
" program.\n" |
" program.\n" |
244 |
" -m, --mailbox MBOX Set default mailbox name.\n" |
" -m, --mailbox MBOX Set default mailbox name.\n" |
245 |
" -u, --user NAME Act as local MDA for user NAME.\n" |
" -u, --user NAME Act as local MDA for user NAME.\n" |
248 |
"\n" |
"\n" |
249 |
"Any arguments between -{ and -} are passed to the Scheme program verbatim.\n" |
"Any arguments between -{ and -} are passed to the Scheme program verbatim.\n" |
250 |
"When both --file and --expression are specified, file is evaluated first.\n" |
"When both --file and --expression are specified, file is evaluated first.\n" |
251 |
"If no mailboxes are specified, the standard input is read.\n\n" |
"If no mailboxes are specified, the system mailbox of the current user is read.\n\n" |
252 |
"The semantics of the default mailbox depends on whether more mailbox\n" |
"The semantics of the default mailbox depends on whether more mailbox\n" |
253 |
"arguments are specified in the command line. If they are, any messages\n" |
"arguments are specified in the command line. If they are, any messages\n" |
254 |
"that are not deleted after executing the script are appended to the default\n" |
"that are not deleted after executing the script are appended to the default\n" |