- invo_name = r1bindex (argv[0], '/');
-
- /* foil search of user profile/context */
- if (context_foil (NULL) == -1)
- done (1);
-
- arguments = getarguments (invo_name, argc, argv, 0);
- 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 [switches]", invo_name);
- print_help (buf, switches, 1);
- done (1);
- case VERSIONSW:
- print_version(invo_name);
- done (1);
-
- case TOSW:
- if (!(f1 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
- continue;
- case SUBJECTSW:
- if (!(f2 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
- continue;
- case PARAMSW:
- if (!(f3 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
- continue;
- case DESCRIPTSW:
- if (!(f4 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
- continue;
- case COMMENTSW:
- if (!(f5 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
- continue;
- case DELAYSW:
- if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
-
- /*
- * If there is an error, just reset the delay parameter
- * to -1. We will set a default delay later.
- */
- if (sscanf (cp, "%d", &delay) != 1)
- delay = -1;
- continue;
- case FROMSW:
- if (!(f7 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
- continue;
-
- case VERBSW:
- verbsw = 1;
- continue;
- case NVERBSW:
- verbsw = 0;
- continue;
-
- case DEBUGSW:
- debugsw = 1;
- continue;
- }
+ invo_name = mhbasename(argv[0]);
+
+ /* foil search of user profile/context */
+ if (context_foil(NULL) == -1)
+ done(1);
+
+ arguments = getarguments(invo_name, argc, argv, 0);
+ 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 [switches]",
+ invo_name);
+ print_help(buf, switches, 1);
+ done(1);
+ case VERSIONSW:
+ print_version(invo_name);
+ done(1);
+
+ case TOSW:
+ if (!(f1 = *argp++))
+ adios(NULL, "missing argument to %s",
+ argp[-2]);
+ continue;
+ case SUBJECTSW:
+ if (!(f2 = *argp++))
+ adios(NULL, "missing argument to %s",
+ argp[-2]);
+ continue;
+ case PARAMSW:
+ if (!(f3 = *argp++))
+ adios(NULL, "missing argument to %s",
+ argp[-2]);
+ continue;
+ case DESCRIPTSW:
+ if (!(f4 = *argp++))
+ adios(NULL, "missing argument to %s",
+ argp[-2]);
+ continue;
+ case COMMENTSW:
+ if (!(f5 = *argp++))
+ adios(NULL, "missing argument to %s",
+ argp[-2]);
+ continue;
+ case FROMSW:
+ if (!(f7 = *argp++))
+ adios(NULL, "missing argument to %s",
+ argp[-2]);
+ continue;
+
+ case VERBSW:
+ verbsw = 1;
+ continue;
+ case NVERBSW:
+ verbsw = 0;
+ continue;
+
+ case DEBUGSW:
+ debugsw = 1;
+ continue;
+ }
+ }