- 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)
This commit is contained in:
Gabor Kovesdan 2010-07-29 18:02:57 +00:00
parent ee6a02813b
commit 97a012f24a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=210622
11 changed files with 38 additions and 52 deletions

View File

@ -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;

View File

@ -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"

View File

@ -4,11 +4,10 @@ $set 1
$quote "
1 "(entrada estándar)"
2 "no se puede leer el fichero comprimido bzip2"
3 "opción desconocida de --color"
3 "opción 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=acción] [--label] [--line-buffered]\n"
7 "\t[--null] [pauta] [fichero ...]\n"
8 "opción 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"

View File

@ -4,11 +4,10 @@ $set 1
$quote "
1 "(entrada estándar)"
2 "non se pode ler o ficheiro comprimido bzip2"
3 "opción descoñecida de --color"
3 "opción descoñecida 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=acción] [--label] [--line-buffered]\n"
7 "\t[--null] [pauta] [ficheiro ...]\n"
8 "opción descoñecida 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"

View File

@ -4,11 +4,10 @@ $set 1
$quote "
1 "(szabványos bemenet)"
2 "bzip2 tömörített fájl nem olvasható"
3 "ismeretlen --color opció"
3 "ismeretlen %s opció"
4 "használat: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A szám] [-B szám] [-C[szám]]\n"
5 "\t[-e minta] [-f fájl] [--binary-files=érték] [--color=mikor]\n"
6 "\t[--context[=szám]] [--directories=művelet] [--label] [--line-buffered]\n"
7 "\t[--null] [minta] [fájl ...]\n"
8 "ismeretlen --binary-files opció"
9 "%s bináris fájl illeszkedik\n"
10 "%s (BSD grep) %s\n"
8 "%s bináris fájl illeszkedik\n"
9 "%s (BSD grep) %s\n"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -4,11 +4,10 @@ $set 1
$quote "
1 "(entrada padrão)"
2 "não se posso ler o fichero comprimido bzip2"
3 "opcão não conhecida de --color"
3 "opcão não conhecida de %s"
4 "uso: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A num] [-B num] [-C[num]]\n"
5 "\t[-e padrão] [-f arquivo] [--binary-files=valor] [--color=quando]\n"
6 "\t[--context[=num]] [--directories=ação] [--label] [--line-buffered]\n"
7 "\t[--null] [padrão] [arquivo ...]\n"
8 "opcão não conhecida de --binary-files"
9 "arquivo binário %s casa com o padrão\n"
10 "%s (BSD grep) %s\n"
8 "arquivo binário %s casa com o padrão\n"
9 "%s (BSD grep) %s\n"

View File

@ -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"

View File

@ -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);