+ invo_name = r1bindex (argv[0], '/');
+
+ /* read user profile/context */
+ context_read();
+
+ mts_init (invo_name);
+ arguments = getarguments (invo_name, argc, argv, 1);
+ argp = arguments;
+
+ while ((cp = *argp++)) {
+ if (*cp == '-') {
+ switch (smatch (++cp, switches)) {
+ case AMBIGSW:
+ ambigsw (cp, switches);
+ done (1);
+ case UNKWNSW:
+ adios (NULL, "-%s unknown", cp);
+
+ case HELPSW:
+ snprintf (buf, sizeof(buf), "%s [+folder] [switches]", invo_name);
+ print_help (buf, switches, 1);
+ done (1);
+ case VERSIONSW:
+ print_version(invo_name);
+ done (1);
+
+ case AUDSW:
+ if (!(cp = *argp++) || *cp == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ audfile = getcpy (m_maildir (cp));
+ continue;
+ case NAUDSW:
+ audfile = NULL;
+ continue;
+
+ case CHGSW:
+ chgflag++;
+ continue;
+ case NCHGSW:
+ chgflag = 0;
+ continue;
+
+ /*
+ ** The flag `trnflag' has the value:
+ **
+ ** 2 if -truncate is given
+ ** 1 by default (truncating is default)
+ ** 0 if -notruncate is given
+ */
+ case TRNCSW:
+ trnflag = 2;
+ continue;
+ case NTRNCSW:
+ trnflag = 0;
+ continue;
+
+ case FILESW:
+ if (!(cp = *argp++) || *cp == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ from = path (cp, TFILE);
+
+ /*
+ ** If the truncate file is in default state,
+ ** change to not truncate.
+ */
+ if (trnflag == 1)
+ trnflag = 0;
+ continue;
+
+ case SILSW:
+ noisy = 0;
+ continue;
+ case NSILSW:
+ noisy++;
+ continue;
+
+ case FORMSW:
+ if (!(form = *argp++) || *form == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ format = NULL;
+ continue;
+ case FMTSW:
+ if (!(format = *argp++) || *format == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ form = NULL;
+ continue;
+
+ case WIDTHSW:
+ if (!(cp = *argp++) || *cp == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ width = atoi (cp);
+ continue;
+ }
+ }
+ if (*cp == '+' || *cp == '@') {
+ if (folder)
+ adios (NULL, "only one folder at a time!");
+ else
+ folder = pluspath (cp);
+ } else {
+ adios (NULL, "usage: %s [+folder] [switches]", invo_name);
+ }