home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_10_06
/
1006076a
< prev
next >
Wrap
Text File
|
1992-04-21
|
590b
|
31 lines
#include "makedef.h"
long parse_options(int argc, char *argv[], char *makefile, char *target)
{
int i = 0;
while (++i < argc) {
if (argv[i][0] != '-')
fatal_error("all options must begin with '-'.");
switch(toupper(argv[i][1])) {
case 'F':
if (argc > i+1)
strcpy(makefile,argv[i+1]);
else
fatal_error("'-f' argument not found.");
break;
case 'T':
if (argc > i+1)
strcpy(target, argv[i+1]);
else
fatal_error("'-t' argument not found.");
break;
default:
fatal_error("invalid option found.");
}
i++;
}
}