- invo_name = r1bindex (argv[0], '/');
-
- /* foil search of user profile/context */
- if (context_foil (NULL) == -1)
- done (1);
-
- mts_init (invo_name);
- 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] [aliasfiles ...]",
- invo_name);
- print_help (buf, switches, 0);
- done (1);
- case VERSIONSW:
- print_version(invo_name);
- done (1);
-
- case MAILSW:
- if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
- if (mail)
- adios (NULL, "mail to one address only");
- else
- mail = cp;
- continue;
-
- case SERCHSW:
- if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
- if (dp >= NDIRS)
- adios (NULL, "more than %d directories", NDIRS);
- dirs[dp++] = cp;
- continue;
- }
+ invo_name = mhbasename(argv[0]);
+
+ /* foil search of user profile/context */
+ if (context_foil(NULL) == -1)
+ done(1);
+
+ mts_init(invo_name);
+ 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] [aliasfiles ...]", invo_name);
+ print_help(buf, switches, 0);
+ done(1);
+ case VERSIONSW:
+ print_version(invo_name);
+ done(1);
+
+ case MAILSW:
+ if (!(cp = *argp++) || *cp == '-')
+ adios(NULL, "missing argument to %s",
+ argp[-2]);
+ if (mail)
+ adios(NULL, "mail to one address only");
+ else
+ mail = cp;
+ continue;
+
+ case SERCHSW:
+ if (!(cp = *argp++) || *cp == '-')
+ adios(NULL, "missing argument to %s",
+ argp[-2]);
+ if (dp >= NDIRS)
+ adios(NULL, "more than %d directories",
+ NDIRS);
+ dirs[dp++] = cp;
+ continue;
+ }
+ }
+ akv[akp++] = cp;