- if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
- switch (*icachesw = smatch (cp, caches)) {
- case AMBIGSW:
- ambigsw (cp, caches);
- done (1);
- case UNKWNSW:
- adios (NULL, "%s unknown", cp);
- default:
- break;
+ if (!(cp = *argp++) || *cp == '-')
+ adios(NULL, "missing argument to %s",
+ argp[-2]);
+ switch (*icachesw = smatch(cp, caches)) {
+ case AMBIGSW:
+ ambigsw(cp, caches);
+ done(1);
+ case UNKWNSW:
+ adios(NULL, "%s unknown", cp);
+ default:
+ break;
+ }
+ continue;
+
+ case CHECKSW:
+ checksw++;
+ continue;
+ case NCHECKSW:
+ checksw = 0;
+ continue;
+
+ case PARTSW:
+ if (!(cp = *argp++) || *cp == '-')
+ adios(NULL, "missing argument to %s",
+ argp[-2]);
+ if (npart >= NPARTS)
+ adios(NULL, "too many parts (starting with %s), %d max", cp, NPARTS);
+ parts[npart++] = cp;
+ continue;
+
+ case TYPESW:
+ if (!(cp = *argp++) || *cp == '-')
+ adios(NULL, "missing argument to %s",
+ argp[-2]);
+ if (ntype >= NTYPES)
+ adios(NULL, "too many types (starting with %s), %d max", cp, NTYPES);
+ types[ntype++] = cp;
+ continue;
+
+ case FILESW:
+ if (!(cp = *argp++) || (*cp == '-' && cp[1]))
+ adios(NULL, "missing argument to %s",
+ argp[-2]);
+ file = *cp == '-' ? cp : getcpy(expanddir(cp));
+ continue;
+
+ case VERBSW:
+ verbosw = 1;
+ continue;
+ case NVERBSW:
+ verbosw = 0;
+ continue;
+ case DEBUGSW:
+ debugsw = 1;
+ continue;
+ }
+ }
+ if (*cp == '+' || *cp == '@') {
+ if (folder)
+ adios(NULL, "only one folder at a time!");
+ else
+ folder = getcpy(expandfol(cp));
+ } else
+ app_msgarg(&msgs, cp);
+ }
+
+ /* null terminate the list of acceptable parts/types */
+ parts[npart] = NULL;
+ types[ntype] = NULL;
+
+ set_endian();
+
+ /*
+ ** Check if we've specified an additional profile
+ */
+ if ((cp = getenv("MHSTORE"))) {
+ if ((fp = fopen(cp, "r"))) {
+ readconfig((struct node **) 0, fp, cp, 0);
+ fclose(fp);
+ } else {
+ admonish("", "unable to read $MHSTORE profile (%s)",
+ cp);