diff options
author | gabor <gabor@FreeBSD.org> | 2010-07-29 18:02:57 +0000 |
---|---|---|
committer | gabor <gabor@FreeBSD.org> | 2010-07-29 18:02:57 +0000 |
commit | 32773dc6ee3f0d5e900ca06397917b0542c56d12 (patch) | |
tree | a2b75c216ccd1af2b496bc8500444d18da4b2b05 /usr.bin | |
parent | 7a37e08cf0fb6f58b3cde2d1bc1484799d821090 (diff) | |
download | FreeBSD-src-32773dc6ee3f0d5e900ca06397917b0542c56d12.zip FreeBSD-src-32773dc6ee3f0d5e900ca06397917b0542c56d12.tar.gz |
- 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)
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/grep/grep.c | 25 | ||||
-rw-r--r-- | usr.bin/grep/nls/C.msg | 7 | ||||
-rw-r--r-- | usr.bin/grep/nls/es_ES.ISO8859-1.msg | 7 | ||||
-rw-r--r-- | usr.bin/grep/nls/gl_ES.ISO8859-1.msg | 7 | ||||
-rw-r--r-- | usr.bin/grep/nls/hu_HU.ISO8859-2.msg | 7 | ||||
-rw-r--r-- | usr.bin/grep/nls/ja_JP.SJIS.msg | 7 | ||||
-rw-r--r-- | usr.bin/grep/nls/ja_JP.UTF-8.msg | 7 | ||||
-rw-r--r-- | usr.bin/grep/nls/ja_JP.eucJP.msg | 7 | ||||
-rw-r--r-- | usr.bin/grep/nls/pt_BR.ISO8859-1.msg | 7 | ||||
-rw-r--r-- | usr.bin/grep/nls/ru_RU.KOI8-R.msg | 7 | ||||
-rw-r--r-- | usr.bin/grep/util.c | 2 |
11 files changed, 38 insertions, 52 deletions
diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index 1de68d0..3dc1a1c 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -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; diff --git a/usr.bin/grep/nls/C.msg b/usr.bin/grep/nls/C.msg index d29e4ab..6327b27 100644 --- a/usr.bin/grep/nls/C.msg +++ b/usr.bin/grep/nls/C.msg @@ -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" diff --git a/usr.bin/grep/nls/es_ES.ISO8859-1.msg b/usr.bin/grep/nls/es_ES.ISO8859-1.msg index 884d2f9..208e91d 100644 --- a/usr.bin/grep/nls/es_ES.ISO8859-1.msg +++ b/usr.bin/grep/nls/es_ES.ISO8859-1.msg @@ -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" diff --git a/usr.bin/grep/nls/gl_ES.ISO8859-1.msg b/usr.bin/grep/nls/gl_ES.ISO8859-1.msg index 77ffd84..9f3915a 100644 --- a/usr.bin/grep/nls/gl_ES.ISO8859-1.msg +++ b/usr.bin/grep/nls/gl_ES.ISO8859-1.msg @@ -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" diff --git a/usr.bin/grep/nls/hu_HU.ISO8859-2.msg b/usr.bin/grep/nls/hu_HU.ISO8859-2.msg index 86d3d91..6d3c1c9 100644 --- a/usr.bin/grep/nls/hu_HU.ISO8859-2.msg +++ b/usr.bin/grep/nls/hu_HU.ISO8859-2.msg @@ -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" diff --git a/usr.bin/grep/nls/ja_JP.SJIS.msg b/usr.bin/grep/nls/ja_JP.SJIS.msg index f3d7757..d18edd5 100644 --- a/usr.bin/grep/nls/ja_JP.SJIS.msg +++ b/usr.bin/grep/nls/ja_JP.SJIS.msg @@ -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" diff --git a/usr.bin/grep/nls/ja_JP.UTF-8.msg b/usr.bin/grep/nls/ja_JP.UTF-8.msg index ec73bce..84c6f45 100644 --- a/usr.bin/grep/nls/ja_JP.UTF-8.msg +++ b/usr.bin/grep/nls/ja_JP.UTF-8.msg @@ -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" diff --git a/usr.bin/grep/nls/ja_JP.eucJP.msg b/usr.bin/grep/nls/ja_JP.eucJP.msg index ba1a15a..e778c5f 100644 --- a/usr.bin/grep/nls/ja_JP.eucJP.msg +++ b/usr.bin/grep/nls/ja_JP.eucJP.msg @@ -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" diff --git a/usr.bin/grep/nls/pt_BR.ISO8859-1.msg b/usr.bin/grep/nls/pt_BR.ISO8859-1.msg index c7246f7..79c026e 100644 --- a/usr.bin/grep/nls/pt_BR.ISO8859-1.msg +++ b/usr.bin/grep/nls/pt_BR.ISO8859-1.msg @@ -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" diff --git a/usr.bin/grep/nls/ru_RU.KOI8-R.msg b/usr.bin/grep/nls/ru_RU.KOI8-R.msg index 3d153d2..6880d51 100644 --- a/usr.bin/grep/nls/ru_RU.KOI8-R.msg +++ b/usr.bin/grep/nls/ru_RU.KOI8-R.msg @@ -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" diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index 95a68b3..9618dea 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -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); |