+ invo_name = r1bindex (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] [msg] [switches]",
+ invo_name);
+ print_help (buf, switches, 1);
+ done (1);
+ case VERSIONSW:
+ print_version(invo_name);
+ done (1);
+
+ case ANNOSW:
+ anot++;
+ continue;
+ case NANNOSW:
+ anot = 0;
+ continue;
+
+ case EDITRSW:
+ if (!(ed = *argp++) || *ed == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ nedit = 0;
+ continue;
+ case NEDITSW:
+ nedit++;
+ continue;
+
+ case WHATSW:
+ if (!(whatnowproc = *argp++) || *whatnowproc == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ nwhat = 0;
+ continue;
+ case NWHATSW:
+ nwhat++;
+ continue;
+
+ case FILESW:
+ if (file)
+ adios (NULL, "only one file at a time!");
+ if (!(cp = *argp++) || *cp == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ file = path (cp, TFILE);
+ continue;
+ case FORMSW:
+ if (!(form = *argp++) || *form == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ continue;
+
+ case INPLSW:
+ inplace++;
+ continue;
+ case NINPLSW:
+ inplace = 0;
+ continue;
+ }
+ }
+ if (*cp == '+' || *cp == '@') {
+ if (folder)
+ adios (NULL, "only one folder at a time!");
+ else
+ folder = pluspath (cp);
+ } else {
+ if (msg)
+ adios (NULL, "only one message at a time!");
+ else
+ msg = cp;
+ }
+ }