/[mailutils]/mailutils/mh/refile.c
ViewVC logotype

Diff of /mailutils/mh/refile.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by gray, Sun Feb 16 11:26:12 2003 UTC revision 1.19 by gray, Thu Feb 20 13:58:24 2003 UTC
# Line 36  static struct argp_option options[] = { Line 36  static struct argp_option options[] = {
36     N_("Specify folder to operate upon")},     N_("Specify folder to operate upon")},
37    {"draft",   ARG_DRAFT, NULL, 0,    {"draft",   ARG_DRAFT, NULL, 0,
38     N_("Use <mh-dir>/draft as the source message")},     N_("Use <mh-dir>/draft as the source message")},
39    {"link",    ARG_LINK, N_("BOOL"), OPTION_ARG_OPTIONAL,    {"copy",    ARG_LINK, N_("BOOL"), OPTION_ARG_OPTIONAL,
40     N_("* Preserve the source folder copy")},     N_("Preserve the source folder copy.")},
41      {"link",    0, NULL, OPTION_ALIAS, NULL},
42    {"preserve", ARG_PRESERVE, N_("BOOL"), OPTION_ARG_OPTIONAL,    {"preserve", ARG_PRESERVE, N_("BOOL"), OPTION_ARG_OPTIONAL,
43     N_("* Try to preserve message sequence numbers")},     N_("* Try to preserve message sequence numbers")},
44    {"source", ARG_SOURCE, N_("FOLDER"), 0,    {"source", ARG_SOURCE, N_("FOLDER"), 0,
# Line 57  struct mh_option mh_option[] = { Line 58  struct mh_option mh_option[] = {
58    { 0 }    { 0 }
59  };  };
60    
61  int link_flag = 1;  int link_flag = 0;
62  int preserve_flag = 0;  int preserve_flag = 0;
63  char *source_file = NULL;  char *source_file = NULL;
64  list_t folder_name_list = NULL;  list_t folder_name_list = NULL;
# Line 149  opt_handler (int key, char *arg, void *u Line 150  opt_handler (int key, char *arg, void *u
150  {  {
151    switch (key)    switch (key)
152      {      {
     case '+':  
153      case ARG_FOLDER:      case ARG_FOLDER:
154        add_folder (arg);        add_folder (arg);
155        break;        break;
# Line 218  main (int argc, char **argv) Line 218  main (int argc, char **argv)
218    int index;    int index;
219    mh_msgset_t msgset;    mh_msgset_t msgset;
220    mailbox_t mbox;    mailbox_t mbox;
221    int status;    int status, i, j;
222    
223    /* Native Language Support */    /* Native Language Support */
224    mu_init_nls ();    mu_init_nls ();
# Line 226  main (int argc, char **argv) Line 226  main (int argc, char **argv)
226    mh_argp_parse (argc, argv, 0, options, mh_option, args_doc, doc,    mh_argp_parse (argc, argv, 0, options, mh_option, args_doc, doc,
227                   opt_handler, NULL, &index);                   opt_handler, NULL, &index);
228    
229      argc -= index;
230      argv += index;
231    
232      /* Collect any surplus folders */
233      for (i = j = 0; i < argc; i++)
234        {
235          if (argv[i][0] == '+')
236            add_folder (argv[i]);
237          else
238            argv[j++] = argv[i];
239        }
240      argv[j] = NULL;
241      argc = j;
242      
243    open_folders ();    open_folders ();
244    
245    if (source_file)    if (source_file)
246      {      {
247        message_t msg;        message_t msg;
248                
249        if (index < argc)        if (argc > 0)
250          {          {
251            mh_error (_("both message set and source file given"));            mh_error (_("both message set and source file given"));
252            exit (1);            exit (1);
# Line 246  main (int argc, char **argv) Line 260  main (int argc, char **argv)
260    else    else
261      {      {
262        mbox = mh_open_folder (current_folder, 0);        mbox = mh_open_folder (current_folder, 0);
263        mh_msgset_parse (mbox, &msgset, argc - index, argv + index, "cur");        mh_msgset_parse (mbox, &msgset, argc, argv, "cur");
264    
265        status = mh_iterate (mbox, &msgset, refile_iterator, NULL);        status = mh_iterate (mbox, &msgset, refile_iterator, NULL);
266    
267    mailbox_expunge (mbox);        mailbox_expunge (mbox);
268    mailbox_close (mbox);        mailbox_close (mbox);
269    mailbox_destroy (&mbox);        mailbox_destroy (&mbox);
270      }      }
271    
272    close_folders ();    close_folders ();

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26