+ invo_name = mhbasename(argv[0]);
+
+ /* read user profile/context */
+ context_read();
+
+ 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(expanddir(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 = getcpy(expanddir(cp));
+
+ /*
+ ** 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]);
+ 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 = getcpy(expandfol(cp));
+ } else {
+ adios(NULL, "usage: %s [+folder] [switches]",
+ invo_name);
+ }