version 1.60, 2003/04/06 22:47:14 |
version 1.61, 2003/04/21 23:14:06 |
|
|
int argc; |
int argc; |
char **argv; |
char **argv; |
{ |
{ |
extern int optind; |
int c, optend; |
extern char *optarg; |
|
int c; |
|
int forceJobs = 0; |
int forceJobs = 0; |
|
|
#define OPTFLAGS "BD:I:PSV:d:ef:ij:km:nqrst" |
#define OPTFLAGS "BD:I:PSV:d:ef:ij:km:nqrst" |
|
|
|
|
optind = 1; /* since we're called more than once */ |
optind = 1; /* since we're called more than once */ |
optreset = 1; |
optreset = 1; |
|
optend = 0; |
while (optind < argc) { |
while (optind < argc) { |
switch (c = getopt(argc, argv, OPTFLAGS)) { |
if (!optend && argv[optind][0] == '-') { |
|
if (argv[optind][1] == '\0') |
|
optind++; /* ignore "-" */ |
|
else if (argv[optind][1] == '-' && |
|
argv[optind][2] == '\0') { |
|
optind++; /* ignore "--" */ |
|
optend++; /* "--" denotes end of flags */ |
|
} |
|
} |
|
c = optend ? -1 : getopt(argc, argv, OPTFLAGS); |
|
switch (c) { |
case 'D': |
case 'D': |
Var_Set(optarg, "1", VAR_GLOBAL); |
Var_Set(optarg, "1", VAR_GLOBAL); |
record_option(c, optarg); |
record_option(c, optarg); |
|
|
!Parse_DoVar(argv[optind], VAR_CMD)) { |
!Parse_DoVar(argv[optind], VAR_CMD)) { |
if (!*argv[optind]) |
if (!*argv[optind]) |
Punt("illegal (null) argument."); |
Punt("illegal (null) argument."); |
if (strcmp(argv[optind], "-") != 0) |
Lst_AtEnd(create, estrdup(argv[optind])); |
Lst_AtEnd(create, estrdup(argv[optind])); |
|
} |
} |
optind++; /* skip over non-option */ |
optind++; /* skip over non-option */ |
break; |
break; |