- 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 [switches] aliases ...",
- invo_name);
- print_help (buf, switches, 1);
- done (1);
- case VERSIONSW:
- print_version (invo_name);
- done (1);
-
- case ALIASW:
- if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
- if ((i = alias (cp)) != AK_OK)
- adios (NULL, "aliasing error in %s - %s", cp, akerror (i));
- continue;
- case NALIASW:
- noalias++;
- continue;
-
- case LISTSW:
- list++;
- continue;
- case NLISTSW:
- list = 0;
- continue;
-
- case NORMSW:
- normalize = AD_HOST;
- continue;
- case NNORMSW:
- normalize = AD_NHST;
- continue;
-
- case USERSW:
- inverted++;
- continue;
- case NUSERSW:
- inverted = 0;
- continue;
- }
+ invo_name = mhbasename(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 [switches] aliases ...",
+ invo_name);
+ print_help(buf, switches, 1);
+ done(1);
+ case VERSIONSW:
+ print_version(invo_name);
+ done(1);
+
+ case ALIASW:
+ if (!(cp = *argp++) || *cp == '-')
+ adios(NULL, "missing argument to %s", argp[-2]);
+ if ((i = alias(cp)) != AK_OK)
+ adios(NULL, "aliasing error in %s - %s", cp, akerror(i));
+ continue;
+ case NALIASW:
+ noalias++;
+ continue;
+
+ case LISTSW:
+ list++;
+ continue;
+ case NLISTSW:
+ list = 0;
+ continue;
+
+ case NORMSW:
+ normalize = AD_HOST;
+ continue;
+ case NNORMSW:
+ normalize = AD_NHST;
+ continue;
+
+ case USERSW:
+ inverted++;
+ continue;
+ case NUSERSW:
+ inverted = 0;
+ continue;
+ }
+ }
+ vec[vecp++] = cp;