21 |
|
|
22 |
const char *argp_program_version = "inc (" PACKAGE_STRING ")"; |
const char *argp_program_version = "inc (" PACKAGE_STRING ")"; |
23 |
static char doc[] = "GNU MH inc"; |
static char doc[] = "GNU MH inc"; |
24 |
static char args_doc[] = ""; |
static char args_doc[] = "[+folder]"; |
25 |
|
|
26 |
/* GNU options */ |
/* GNU options */ |
27 |
static struct argp_option options[] = { |
static struct argp_option options[] = { |
66 |
static int changecur = -1; |
static int changecur = -1; |
67 |
static int truncate_source = -1; |
static int truncate_source = -1; |
68 |
static int quiet = 0; |
static int quiet = 0; |
69 |
|
static char *append_folder; |
70 |
|
|
71 |
static int |
static int |
72 |
opt_handler (int key, char *arg, void *unused) |
opt_handler (int key, char *arg, void *unused) |
73 |
{ |
{ |
74 |
switch (key) |
switch (key) |
75 |
{ |
{ |
76 |
|
case ARGP_KEY_FINI: |
77 |
|
if (!append_folder) |
78 |
|
append_folder = mh_global_profile_get ("Inbox", "inbox"); |
79 |
|
break; |
80 |
|
|
81 |
case 'a': |
case 'a': |
82 |
audit_file = arg; |
audit_file = arg; |
83 |
break; |
break; |
92 |
|
|
93 |
case '+': |
case '+': |
94 |
case 'f': |
case 'f': |
95 |
current_folder = arg; |
append_folder = arg; |
96 |
break; |
break; |
97 |
|
|
98 |
case 'F': |
case 'F': |
193 |
exit (1); |
exit (1); |
194 |
} |
} |
195 |
|
|
196 |
output = mh_open_folder (current_folder, 1); |
output = mh_open_folder (append_folder, 1); |
197 |
if (mailbox_messages_count (output, &lastmsg) != 0) |
if (mailbox_messages_count (output, &lastmsg) != 0) |
198 |
{ |
{ |
199 |
mh_error ("Can not read output mailbox"); |
mh_error ("Can not read output mailbox"); |