Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jul 2010 18:02:58 +0000 (UTC)
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r210622 - in head/usr.bin/grep: . nls
Message-ID:  <201007291802.o6TI2wcJ014551@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gabor
Date: Thu Jul 29 18:02:57 2010
New Revision: 210622
URL: http://svn.freebsd.org/changeset/base/210622

Log:
  - Some minor changes to the messages to increase usefulness of error msgs
  
  Reviewed by:	hrs (Japanese catalogs),
  		pluknet <pluknet at gmail dot com> (Russian catalog)
  Approved by:	delphij (mentor)

Modified:
  head/usr.bin/grep/grep.c
  head/usr.bin/grep/nls/C.msg
  head/usr.bin/grep/nls/es_ES.ISO8859-1.msg
  head/usr.bin/grep/nls/gl_ES.ISO8859-1.msg
  head/usr.bin/grep/nls/hu_HU.ISO8859-2.msg
  head/usr.bin/grep/nls/ja_JP.SJIS.msg
  head/usr.bin/grep/nls/ja_JP.UTF-8.msg
  head/usr.bin/grep/nls/ja_JP.eucJP.msg
  head/usr.bin/grep/nls/pt_BR.ISO8859-1.msg
  head/usr.bin/grep/nls/ru_RU.KOI8-R.msg
  head/usr.bin/grep/util.c

Modified: head/usr.bin/grep/grep.c
==============================================================================
--- head/usr.bin/grep/grep.c	Thu Jul 29 17:52:23 2010	(r210621)
+++ head/usr.bin/grep/grep.c	Thu Jul 29 18:02:57 2010	(r210622)
@@ -61,14 +61,13 @@ const char	*errstr[] = {
 	"",
 /* 1*/	"(standard input)",
 /* 2*/	"cannot read bzip2 compressed file",
-/* 3*/	"unknown --color option",
+/* 3*/	"unknown %s option",
 /* 4*/	"usage: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A num] [-B num] [-C[num]]\n",
 /* 5*/	"\t[-e pattern] [-f file] [--binary-files=value] [--color=when]\n",
 /* 6*/	"\t[--context[=num]] [--directories=action] [--label] [--line-buffered]\n",
 /* 7*/	"\t[--null] [pattern] [file ...]\n",
-/* 8*/	"unknown --binary-files option",
-/* 9*/	"Binary file %s matches\n",
-/*10*/	"%s (BSD grep) %s\n",
+/* 8*/	"Binary file %s matches\n",
+/* 9*/	"%s (BSD grep) %s\n",
 };
 
 /* Flags passed to regcomp() and regexec() */
@@ -445,10 +444,8 @@ main(int argc, char *argv[])
 				devbehave = DEV_SKIP;
 			else if (strcasecmp(optarg, "read") == 0)
 				devbehave = DEV_READ;
-			else {
-				errno = EINVAL;
-				err(2, NULL);
-			}
+			else
+				errx(2, getstr(3), "--devices");
 			break;
 		case 'd':
 			if (strcasecmp("recurse", optarg) == 0) {
@@ -458,10 +455,8 @@ main(int argc, char *argv[])
 				dirbehave = DIR_SKIP;
 			else if (strcasecmp("read", optarg) == 0)
 				dirbehave = DIR_READ;
-			else {
-				errno = EINVAL;
-				err(2, NULL);
-			}
+			else
+				errx(2, getstr(3), "--directories");
 			break;
 		case 'E':
 			grepbehave = GREP_EXTENDED;
@@ -552,7 +547,7 @@ main(int argc, char *argv[])
 			/* noop, compatibility */
 			break;
 		case 'V':
-			printf(getstr(10), __progname, VERSION);
+			printf(getstr(9), __progname, VERSION);
 			exit(0);
 		case 'v':
 			vflag = true;
@@ -574,7 +569,7 @@ main(int argc, char *argv[])
 			else if (strcasecmp("text", optarg) == 0)
 				binbehave = BINFILE_TEXT;
 			else
-				errx(2, "%s", getstr(8));
+				errx(2, getstr(3), "--binary-files");
 			break;
 		case COLOR_OPT:
 			color = NULL;
@@ -594,7 +589,7 @@ main(int argc, char *argv[])
 			} else if (strcasecmp("never", optarg) != 0 &&
 			    strcasecmp("none", optarg) != 0 &&
 			    strcasecmp("no", optarg) != 0)
-				errx(2, "%s", getstr(3));
+				errx(2, getstr(3), "--color");
 			break;
 		case LABEL_OPT:
 			label = optarg;

Modified: head/usr.bin/grep/nls/C.msg
==============================================================================
--- head/usr.bin/grep/nls/C.msg	Thu Jul 29 17:52:23 2010	(r210621)
+++ head/usr.bin/grep/nls/C.msg	Thu Jul 29 18:02:57 2010	(r210622)
@@ -4,11 +4,10 @@ $set 1
 $quote "
 1 "(standard input)"
 2 "cannot read bzip2 compressed file"
-3 "unknown --color option"
+3 "unknown %s option"
 4 "usage: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A num] [-B num] [-C[num]]\n"
 5 "\t[-e pattern] [-f file] [--binary-files=value] [--color=when]\n"
 6 "\t[--context[=num]] [--directories=action] [--label] [--line-buffered]\n"
 7 "\t[--null] [pattern] [file ...]\n"
-8 "unknown --binary-files option"
-9 "Binary file %s matches\n"
-10 "%s (BSD grep) %s\n"
+8 "Binary file %s matches\n"
+9 "%s (BSD grep) %s\n"

Modified: head/usr.bin/grep/nls/es_ES.ISO8859-1.msg
==============================================================================
--- head/usr.bin/grep/nls/es_ES.ISO8859-1.msg	Thu Jul 29 17:52:23 2010	(r210621)
+++ head/usr.bin/grep/nls/es_ES.ISO8859-1.msg	Thu Jul 29 18:02:57 2010	(r210622)
@@ -4,11 +4,10 @@ $set 1
 $quote "
 1 "(entrada estndar)"
 2 "no se puede leer el fichero comprimido bzip2"
-3 "opcin desconocida de --color"
+3 "opcin desconocida de %s"
 4 "uso: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A no] [-B no] [-C[no]]\n"
 5 "\t[-e pauta] [-f fichero] [--binary-files=valor] [--color=cuando]\n"
 6 "\t[--context[=no]] [--directories=accin] [--label] [--line-buffered]\n"
 7 "\t[--null] [pauta] [fichero ...]\n"
-8 "opcin desconocida de --binary-files"
-9 "fichero binario %s se ajusta\n"
-10 "%s (BSD grep) %s\n"
+8 "fichero binario %s se ajusta\n"
+9 "%s (BSD grep) %s\n"

Modified: head/usr.bin/grep/nls/gl_ES.ISO8859-1.msg
==============================================================================
--- head/usr.bin/grep/nls/gl_ES.ISO8859-1.msg	Thu Jul 29 17:52:23 2010	(r210621)
+++ head/usr.bin/grep/nls/gl_ES.ISO8859-1.msg	Thu Jul 29 18:02:57 2010	(r210622)
@@ -4,11 +4,10 @@ $set 1
 $quote "
 1 "(entrada estndar)"
 2 "non se pode ler o ficheiro comprimido bzip2"
-3 "opcin descoecida de --color"
+3 "opcin descoecida de %s"
 4 "uso: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A no] [-B no] [-C[no]]\n"
 5 "\t[-e pauta] [-f ficheiro] [--binary-files=valor] [--color=cando]\n"
 6 "\t[--context[=no]] [--directories=accin] [--label] [--line-buffered]\n"
 7 "\t[--null] [pauta] [ficheiro ...]\n"
-8 "opcin descoecida de --binary-files"
-9 "ficheiro binario %s conforma\n"
-10 "%s (BSD grep) %s\n"
+8 "ficheiro binario %s conforma\n"
+9 "%s (BSD grep) %s\n"

Modified: head/usr.bin/grep/nls/hu_HU.ISO8859-2.msg
==============================================================================
--- head/usr.bin/grep/nls/hu_HU.ISO8859-2.msg	Thu Jul 29 17:52:23 2010	(r210621)
+++ head/usr.bin/grep/nls/hu_HU.ISO8859-2.msg	Thu Jul 29 18:02:57 2010	(r210622)
@@ -4,11 +4,10 @@ $set 1
 $quote "
 1 "(szabvnyos bemenet)"
 2 "bzip2 tmrtett fjl nem olvashat"
-3 "ismeretlen --color opci"
+3 "ismeretlen %s opci"
 4 "hasznlat: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A szm] [-B szm] [-C[szm]]\n"
 5 "\t[-e minta] [-f fjl] [--binary-files=rtk] [--color=mikor]\n"
 6 "\t[--context[=szm]] [--directories=mvelet] [--label] [--line-buffered]\n"
 7 "\t[--null] [minta] [fjl ...]\n"
-8 "ismeretlen --binary-files opci"
-9 "%s binris fjl illeszkedik\n"
-10 "%s (BSD grep) %s\n"
+8 "%s binris fjl illeszkedik\n"
+9 "%s (BSD grep) %s\n"

Modified: head/usr.bin/grep/nls/ja_JP.SJIS.msg
==============================================================================
--- head/usr.bin/grep/nls/ja_JP.SJIS.msg	Thu Jul 29 17:52:23 2010	(r210621)
+++ head/usr.bin/grep/nls/ja_JP.SJIS.msg	Thu Jul 29 18:02:57 2010	(r210622)
@@ -4,11 +4,10 @@ $set 1
 $quote "
 1 "(W)"
 2 "bzip2 kt@CǂݍނƂł܂"
-3 "--color IvV̎wlɌ肪܂"
+3 "%s IvV̎wlɌ肪܂"
 4 "g: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A ] [-B ] [-C[]]\n"
 5 "\t[-e p^[] [-f t@C] [--binary-files=l] [--color=l]\n"
 6 "\t[--context[=]] [--directories=] [--label] [--line-buffered]\n"
 7 "\t[--null] [p^[] [t@C ...]\n"
-8 "--binary-files IvV̎wlɌ肪܂"
-9 "oCit@C %s Ƀ}b`܂\n"
-10 "%s (BSD grep) %s\n"
+8 "oCit@C %s Ƀ}b`܂\n"
+9 "%s (BSD grep) %s\n"

Modified: head/usr.bin/grep/nls/ja_JP.UTF-8.msg
==============================================================================
--- head/usr.bin/grep/nls/ja_JP.UTF-8.msg	Thu Jul 29 17:52:23 2010	(r210621)
+++ head/usr.bin/grep/nls/ja_JP.UTF-8.msg	Thu Jul 29 18:02:57 2010	(r210622)
@@ -4,11 +4,10 @@ $set 1
 $quote "
 1 "(標準入力)"
 2 "bzip2 圧縮ファイルを読み込むことができません"
-3 "--color オプションの指定値に誤りがあります"
+3 "%s オプションの指定値に誤りがあります"
 4 "使い方: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A 数字] [-B 数字] [-C[数字]]\n"
 5 "\t[-e パターン] [-f ファイル名] [--binary-files=値] [--color=値]\n"
 6 "\t[--context[=数字]] [--directories=動作] [--label] [--line-buffered]\n"
 7 "\t[--null] [パターン] [ファイル名 ...]\n"
-8 "--binary-files オプションの指定値に誤りがあります"
-9 "バイナリファイル %s にマッチしました\n"
-10 "%s (BSD grep) %s\n"
+8 "バイナリファイル %s にマッチしました\n"
+9 "%s (BSD grep) %s\n"

Modified: head/usr.bin/grep/nls/ja_JP.eucJP.msg
==============================================================================
--- head/usr.bin/grep/nls/ja_JP.eucJP.msg	Thu Jul 29 17:52:23 2010	(r210621)
+++ head/usr.bin/grep/nls/ja_JP.eucJP.msg	Thu Jul 29 18:02:57 2010	(r210622)
@@ -4,11 +4,10 @@ $set 1
 $quote "
 1 "(ɸ)"
 2 "bzip2 ̥եɤ߹ळȤǤޤ"
-3 "--color ץλͤ˸꤬ޤ"
+3 "%s ץλͤ˸꤬ޤ"
 4 "Ȥ: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A ] [-B ] [-C[]]\n"
 5 "\t[-e ѥ] [-f ե̾] [--binary-files=] [--color=]\n"
 6 "\t[--context[=]] [--directories=ư] [--label] [--line-buffered]\n"
 7 "\t[--null] [ѥ] [ե̾ ...]\n"
-8 "--binary-files ץλͤ˸꤬ޤ"
-9 "Хʥե %s ˥ޥåޤ\n"
-10 "%s (BSD grep) %s\n"
+8 "Хʥե %s ˥ޥåޤ\n"
+9 "%s (BSD grep) %s\n"

Modified: head/usr.bin/grep/nls/pt_BR.ISO8859-1.msg
==============================================================================
--- head/usr.bin/grep/nls/pt_BR.ISO8859-1.msg	Thu Jul 29 17:52:23 2010	(r210621)
+++ head/usr.bin/grep/nls/pt_BR.ISO8859-1.msg	Thu Jul 29 18:02:57 2010	(r210622)
@@ -4,11 +4,10 @@ $set 1
 $quote "
 1 "(entrada padro)"
 2 "no se posso ler o fichero comprimido bzip2"
-3 "opco no conhecida de --color"
+3 "opco no conhecida de %s"
 4 "uso: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A num] [-B num] [-C[num]]\n"
 5 "\t[-e padro] [-f arquivo] [--binary-files=valor] [--color=quando]\n"
 6 "\t[--context[=num]] [--directories=ao] [--label] [--line-buffered]\n"
 7 "\t[--null] [padro] [arquivo ...]\n"
-8 "opco no conhecida de --binary-files"
-9 "arquivo binrio %s casa com o padro\n"
-10 "%s (BSD grep) %s\n"
+8 "arquivo binrio %s casa com o padro\n"
+9 "%s (BSD grep) %s\n"

Modified: head/usr.bin/grep/nls/ru_RU.KOI8-R.msg
==============================================================================
--- head/usr.bin/grep/nls/ru_RU.KOI8-R.msg	Thu Jul 29 17:52:23 2010	(r210621)
+++ head/usr.bin/grep/nls/ru_RU.KOI8-R.msg	Thu Jul 29 18:02:57 2010	(r210622)
@@ -4,11 +4,10 @@ $set 1
 $quote "
 1 "( )"
 2 "     bzip2 "
-3 "  --color"
+3 "  %s"
 4 ": %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A ] [-B ] [-C[]]\n"
 5 "\t[-e ] [-f ] [--binary-files=] [--color=]\n"
 6 "\t[--context[=]] [--directories=] [--label] [--line-buffered]\n"
 7 "\t[--null] [] [ ...]\n"
-8 "  --binary-files"
-9 "  %s \n"
-10 "%s (BSD grep) %s\n"
+8 "  %s \n"
+9 "%s (BSD grep) %s\n"

Modified: head/usr.bin/grep/util.c
==============================================================================
--- head/usr.bin/grep/util.c	Thu Jul 29 17:52:23 2010	(r210621)
+++ head/usr.bin/grep/util.c	Thu Jul 29 18:02:57 2010	(r210622)
@@ -260,7 +260,7 @@ procfile(const char *fn)
 		printf("%s\n", fn);
 	if (c && !cflag && !lflag && !Lflag &&
 	    binbehave == BINFILE_BIN && f->binary && !qflag)
-		printf(getstr(9), fn);
+		printf(getstr(8), fn);
 
 	free(ln.file);
 	free(f);



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