version 1.39, 2003/09/06 05:25:22 |
version 1.40, 2003/09/07 18:16:02 |
|
|
struct stat stb1, stb2; |
struct stat stb1, stb2; |
struct excludes *excludes_list; |
struct excludes *excludes_list; |
|
|
#define OPTIONS "abC:c::dD:efhiL:lnNPqrS:sTtU:u::wX:x:" |
#define OPTIONS "0123456789abC:cdD:efhiL:lnNPqrS:sTtU:uwX:x:" |
static struct option longopts[] = { |
static struct option longopts[] = { |
{ "text", no_argument, 0, 'a' }, |
{ "text", no_argument, 0, 'a' }, |
{ "ignore-space-change", no_argument, 0, 'b' }, |
{ "ignore-space-change", no_argument, 0, 'b' }, |
|
|
{ |
{ |
char *ep, **oargv; |
char *ep, **oargv; |
long l; |
long l; |
int ch, gotstdin; |
int ch, lastch, gotstdin; |
|
|
oargv = argv; |
oargv = argv; |
gotstdin = 0; |
gotstdin = 0; |
|
|
|
lastch = 0; |
while ((ch = getopt_long(argc, argv, OPTIONS, longopts, NULL)) != -1) { |
while ((ch = getopt_long(argc, argv, OPTIONS, longopts, NULL)) != -1) { |
switch (ch) { |
switch (ch) { |
|
case '0': case '1': case '2': case '3': case '4': |
|
case '5': case '6': case '7': case '8': case '9': |
|
if (!(lastch == 'c' || lastch == 'u' || |
|
(lastch >= '0' && lastch <= '9'))) |
|
usage(); |
|
if (lastch == 'c' || lastch == 'u') |
|
context = 0; |
|
context = context * 10 + ch - '0'; |
|
break; |
case 'a': |
case 'a': |
aflag = 1; |
aflag = 1; |
break; |
break; |
|
|
usage(); |
usage(); |
break; |
break; |
} |
} |
|
lastch = ch; |
} |
} |
argc -= optind; |
argc -= optind; |
argv += optind; |
argv += optind; |