Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jun 2008 20:41:48 GMT
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 144052 for review
Message-ID:  <200806242041.m5OKfmY5035425@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=144052

Change 144052 by gabor@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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806242041.m5OKfmY5035425>