~ubuntu-dev/ubuntu/lucid/mutt/lucid-201002110857

« back to all changes in this revision

Viewing changes to main.c

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-06-07 17:30:03 UTC
  • mto: (16.2.1 experimental) (2.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20090607173003-rg37ui3h2bbv7wl0
Tags: upstream-1.5.19
ImportĀ upstreamĀ versionĀ 1.5.19

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
To report a bug, please visit http://bugs.mutt.org/.\n");
66
66
 
67
67
static const char *Notice = N_("\
68
 
Copyright (C) 1996-2008 Michael R. Elkins and others.\n\
 
68
Copyright (C) 1996-2009 Michael R. Elkins and others.\n\
69
69
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.\n\
70
70
Mutt is free software, and you are welcome to redistribute it\n\
71
71
under certain conditions; type `mutt -vv' for details.\n");
73
73
static const char *Copyright = N_("\
74
74
Copyright (C) 1996-2007 Michael R. Elkins <me@mutt.org>\n\
75
75
Copyright (C) 1996-2002 Brandon Long <blong@fiction.net>\n\
76
 
Copyright (C) 1997-2007 Thomas Roessler <roessler@does-not-exist.org>\n\
 
76
Copyright (C) 1997-2008 Thomas Roessler <roessler@does-not-exist.org>\n\
77
77
Copyright (C) 1998-2005 Werner Koch <wk@isil.d.shuttle.de>\n\
78
 
Copyright (C) 1999-2008 Brendan Cully <brendan@kublai.com>\n\
 
78
Copyright (C) 1999-2009 Brendan Cully <brendan@kublai.com>\n\
79
79
Copyright (C) 1999-2002 Tommi Komulainen <Tommi.Komulainen@iki.fi>\n\
80
80
Copyright (C) 2000-2002 Edmund Grimley Evans <edmundo@rano.org>\n\
 
81
Copyright (C) 2006-2008 Rocco Rutte <pdmef@gmx.net>\n\
81
82
\n\
82
83
Many others not mentioned here contributed code, fixes,\n\
83
84
and suggestions.\n");
111
112
  puts _(
112
113
"usage: mutt [<options>] [-z] [-f <file> | -yZ]\n\
113
114
       mutt [<options>] [-x] [-Hi <file>] [-s <subj>] [-bc <addr>] [-a <file> [...]] [--] <addr> [...]\n\
 
115
       mutt [<options>] [-x] [-s <subj>] [-bc <addr>] [-a <file> [...]] [--] <addr> [...] < message\n\
114
116
       mutt [<options>] -p\n\
115
117
       mutt [<options>] -A <alias> [...]\n\
116
118
       mutt [<options>] -Q <query> [...]\n\
234
236
        "-DL_STANDALONE  "
235
237
#endif
236
238
 
237
 
        "\n"
238
 
        
239
239
#ifdef USE_FCNTL
240
240
        "+USE_FCNTL  "
241
241
#else
247
247
#else
248
248
        "-USE_FLOCK   "
249
249
#endif
250
 
        );
 
250
    );
251
251
  puts (
252
252
#ifdef USE_POP
253
253
        "+USE_POP  "
266
266
#else
267
267
        "-USE_SMTP  "
268
268
#endif
269
 
 
270
 
#ifdef USE_GSS
271
 
        "+USE_GSS  "
272
 
#else
273
 
        "-USE_GSS  "
274
 
#endif
275
 
 
 
269
        "\n"
276
270
        
277
271
#ifdef USE_SSL_OPENSSL
278
272
        "+USE_SSL_OPENSSL  "
291
285
#else
292
286
        "-USE_SASL  "
293
287
#endif
 
288
#ifdef USE_GSS
 
289
        "+USE_GSS  "
 
290
#else
 
291
        "-USE_GSS  "
 
292
#endif
294
293
 
295
294
#if HAVE_GETADDRINFO
296
295
        "+HAVE_GETADDRINFO  "
544
543
  int dump_variables = 0;
545
544
  extern char *optarg;
546
545
  extern int optind;
547
 
  int attach_sep = 0;
 
546
  int double_dash = argc, nargc = 1;
548
547
 
549
548
  /* sanity check against stupid administrators */
550
549
  
572
571
  memset (Options, 0, sizeof (Options));
573
572
  memset (QuadOptions, 0, sizeof (QuadOptions));
574
573
 
575
 
  for (i = 1; i < argc; i++)
576
 
    if (!strcmp(argv[i], "--"))
 
574
  for (optind = 1; optind < double_dash; )
 
575
  {
 
576
    /* We're getopt'ing POSIXLY, so we'll be here every time getopt()
 
577
     * encounters a non-option.  That could be a file to attach 
 
578
     * (all non-options between -a and --) or it could be an address
 
579
     * (which gets collapsed to the front of argv).
 
580
     */
 
581
    for (; optind < argc; optind++)
577
582
    {
578
 
      attach_sep = i;
579
 
      break;
 
583
      if (argv[optind][0] == '-' && argv[optind][1] != '\0')
 
584
      {
 
585
        if (argv[optind][1] == '-' && argv[optind][2] == '\0')
 
586
          double_dash = optind; /* quit outer loop after getopt */
 
587
        break;                  /* drop through to getopt */
 
588
      }
 
589
 
 
590
      /* non-option, either an attachment or address */
 
591
      if (attach)
 
592
        attach = mutt_add_list (attach, argv[optind]);
 
593
      else
 
594
        argv[nargc++] = argv[optind];
580
595
    }
581
596
 
582
 
  while ((i = getopt (argc, argv, "A:a:b:F:f:c:Dd:e:H:s:i:hm:npQ:RvxyzZ")) != EOF)
583
 
    switch (i)
584
 
    {
 
597
    if ((i = getopt (argc, argv, "+A:a:b:F:f:c:Dd:e:H:s:i:hm:npQ:RvxyzZ")) != EOF)
 
598
      switch (i)
 
599
      {
585
600
      case 'A':
586
601
        alias_queries = mutt_add_list (alias_queries, optarg);
587
602
        break;
682
697
 
683
698
      default:
684
699
        mutt_usage ();
685
 
    }
 
700
      }
 
701
  }
 
702
 
 
703
  /* collapse remaining argv */
 
704
  while (optind < argc)
 
705
    argv[nargc++] = argv[optind++];
 
706
  optind = 1;
 
707
  argc = nargc;
686
708
 
687
709
  switch (version)
688
710
  {
751
773
    return rv;
752
774
  }
753
775
 
754
 
  /* if an -a option is present, all non-option arguments before -- are considered attachments */
755
 
  if (attach)
756
 
    for (; optind <= attach_sep; optind++)
757
 
      attach = mutt_add_list (attach, argv[optind]);
758
 
 
759
776
  if (newMagic)
760
777
    mx_set_magic (newMagic);
761
778