PERFORCE change 144052 for review

Gabor Kovesdan gabor at FreeBSD.org
Tue Jun 24 20:41:49 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=144052

Change 144052 by gabor at gabor_server on 2008/06/24 20:41:16

	- Fix -C
	- Improve some error message

Affected files ...

.. //depot/projects/soc2008/gabor_textproc/grep/grep.c#43 edit
.. //depot/projects/soc2008/gabor_textproc/grep/nls/C.msg#2 edit

Differences ...

==== //depot/projects/soc2008/gabor_textproc/grep/grep.c#43 (text+ko) ====

@@ -69,9 +69,11 @@
 /* 8*/	"parentheses not balanced",
 /* 9*/	"context out of range",
 /*10*/	"FreeBSD grep 2.5.1\n",
-/*11*/	"Unknown binary-files option",
+/*11*/	"Unknown --binary-files option",
 /*12*/	"Binary file %s matches\n",
-/*12*/	"Value out of range"
+/*12*/	"Value out of range",
+/*13*/	"Unknown -d or --directory option",
+/*14*/	"Unknown --color option"
 };
 
 /* Flags passed to regcomp() and regexec() */
@@ -156,7 +158,7 @@
 	exit(2);
 }
 
-static char	*optstr = "0123456789A:B:CD:EFGHIJLOPSRUVZabcd:e:f:hilm:noqrsuvwxy";
+static char	*optstr = "0123456789A:B:C:D:EFGHIJLOPSRUVZabcd:e:f:hilm:noqrsuvwxy";
 
 struct option long_options[] =
 {
@@ -450,7 +452,7 @@
 			} else if (strcmp("skip", optarg) == 0)
 				dirbehave = DIR_SKIP;
 			else if (strcmp("read", optarg) != 0)
-				usage();
+				errx(2, getstr(13));
 			break;
 		case 'E':
 			Fflag = Gflag = 0;
@@ -576,7 +578,7 @@
 			} else if (strcmp("never", optarg) == 0)
 				color = NULL;
 			else
-				usage();
+				errx(2, getstr(14));
 			break;
 		case LABEL_OPT:
 			label = optarg;

==== //depot/projects/soc2008/gabor_textproc/grep/nls/C.msg#2 (text+ko) ====

@@ -12,5 +12,8 @@
 8 "parentheses not balanced"
 9 "context out of range"
 10 "FreeBSD grep 2.5.1\n"
-11 "Unknown binary-files option"
+11 "Unknown --binary-files option"
 12 "Binary file %s matches\n"
+12 "Value out of range"
+13 "Unknown -d or --directory option"
+14 "Unknown --color option"


More information about the p4-projects mailing list