version 1.8, 2003/06/25 21:43:49 |
version 1.9, 2003/06/25 22:14:43 |
|
|
status = 2; |
status = 2; |
diffargv = argv; |
diffargv = argv; |
|
|
while ((ch = getopt(argc, argv, "bC:cD:efhilnrS:stw")) != -1) { |
while ((ch = getopt(argc, argv, "bC:cD:efhilnrS:stU:uw")) != -1) { |
switch (ch) { |
switch (ch) { |
case 'b': |
case 'b': |
bflag++; |
bflag++; |
|
|
case 't': |
case 't': |
tflag++; |
tflag++; |
break; |
break; |
|
case 'U': |
|
opt = D_UNIFIED; |
|
if (!isdigit(*optarg)) |
|
usage(); |
|
context = atoi(optarg); /* XXX - use strtol */ |
|
break; |
|
case 'u': |
|
opt = D_UNIFIED; |
|
context = 3; |
|
break; |
case 'w': |
case 'w': |
wflag++; |
wflag++; |
break; |
break; |
|
|
file1 = argv[0]; |
file1 = argv[0]; |
file2 = argv[1]; |
file2 = argv[1]; |
if (hflag && opt) |
if (hflag && opt) |
errx(1, "-h doesn't support -D, -c, -C, -e, -f, -I or -n"); |
errx(1, "-h doesn't support -D, -c, -C, -e, -f, -I, -n, -u or -U"); |
if (!strcmp(file1, "-")) |
if (!strcmp(file1, "-")) |
stb1.st_mode = S_IFREG; |
stb1.st_mode = S_IFREG; |
else if (stat(file1, &stb1) < 0) |
else if (stat(file1, &stb1) < 0) |
|
|
__dead void |
__dead void |
usage(void) |
usage(void) |
{ |
{ |
(void)fprintf(stderr, "usage: diff [-c | -C lines | -e | -f | -h | -n ] [-biwt] file1 file2\n" |
(void)fprintf(stderr, "usage: diff [-bitw] [-c | -e | -f | -h | -n | -u ] file1 file2\n" |
"usage: diff [-Dstring] [-biw] file1 file2\n" |
" diff [-biw] -Dstring file1 file2\n" |
"usage: diff [-l] [-r] [-s] [-c | -C lines | -e | -f | -h | -n ] [-biwt]\n [-Sname] dir1 dir2\n"); |
" diff [-biwt] [-c | -e | -f | -h | -n | -u ] [-l] [-r] [-s] [-Sname]\n dir1 dir2\n" |
|
" diff [-bitw] -Cnumber [file1 file2 | dir1 dir2]\n" |
|
" diff [-bitw] -Unumber [file1 file2 | dir1 dir2]\n"); |
|
|
exit(1); |
exit(1); |
} |
} |