i18n: grep: mark parseopt strings for translation

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nguyễn Thái Ngọc Duy 2012-08-20 19:32:15 +07:00 committed by Junio C Hamano
parent 6705c1629c
commit 4b407bc506

View file

@ -19,7 +19,7 @@
#include "dir.h" #include "dir.h"
static char const * const grep_usage[] = { static char const * const grep_usage[] = {
"git grep [options] [-e] <pattern> [<rev>...] [[--] <path>...]", N_("git grep [options] [-e] <pattern> [<rev>...] [[--] <path>...]"),
NULL NULL
}; };
@ -680,84 +680,84 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
struct option options[] = { struct option options[] = {
OPT_BOOLEAN(0, "cached", &cached, OPT_BOOLEAN(0, "cached", &cached,
"search in index instead of in the work tree"), N_("search in index instead of in the work tree")),
OPT_NEGBIT(0, "no-index", &use_index, OPT_NEGBIT(0, "no-index", &use_index,
"finds in contents not managed by git", 1), N_("finds in contents not managed by git"), 1),
OPT_BOOLEAN(0, "untracked", &untracked, OPT_BOOLEAN(0, "untracked", &untracked,
"search in both tracked and untracked files"), N_("search in both tracked and untracked files")),
OPT_SET_INT(0, "exclude-standard", &opt_exclude, OPT_SET_INT(0, "exclude-standard", &opt_exclude,
"search also in ignored files", 1), N_("search also in ignored files"), 1),
OPT_GROUP(""), OPT_GROUP(""),
OPT_BOOLEAN('v', "invert-match", &opt.invert, OPT_BOOLEAN('v', "invert-match", &opt.invert,
"show non-matching lines"), N_("show non-matching lines")),
OPT_BOOLEAN('i', "ignore-case", &opt.ignore_case, OPT_BOOLEAN('i', "ignore-case", &opt.ignore_case,
"case insensitive matching"), N_("case insensitive matching")),
OPT_BOOLEAN('w', "word-regexp", &opt.word_regexp, OPT_BOOLEAN('w', "word-regexp", &opt.word_regexp,
"match patterns only at word boundaries"), N_("match patterns only at word boundaries")),
OPT_SET_INT('a', "text", &opt.binary, OPT_SET_INT('a', "text", &opt.binary,
"process binary files as text", GREP_BINARY_TEXT), N_("process binary files as text"), GREP_BINARY_TEXT),
OPT_SET_INT('I', NULL, &opt.binary, OPT_SET_INT('I', NULL, &opt.binary,
"don't match patterns in binary files", N_("don't match patterns in binary files"),
GREP_BINARY_NOMATCH), GREP_BINARY_NOMATCH),
{ OPTION_INTEGER, 0, "max-depth", &opt.max_depth, "depth", { OPTION_INTEGER, 0, "max-depth", &opt.max_depth, N_("depth"),
"descend at most <depth> levels", PARSE_OPT_NONEG, N_("descend at most <depth> levels"), PARSE_OPT_NONEG,
NULL, 1 }, NULL, 1 },
OPT_GROUP(""), OPT_GROUP(""),
OPT_SET_INT('E', "extended-regexp", &pattern_type, OPT_SET_INT('E', "extended-regexp", &pattern_type,
"use extended POSIX regular expressions", N_("use extended POSIX regular expressions"),
pattern_type_ere), pattern_type_ere),
OPT_SET_INT('G', "basic-regexp", &pattern_type, OPT_SET_INT('G', "basic-regexp", &pattern_type,
"use basic POSIX regular expressions (default)", N_("use basic POSIX regular expressions (default)"),
pattern_type_bre), pattern_type_bre),
OPT_SET_INT('F', "fixed-strings", &pattern_type, OPT_SET_INT('F', "fixed-strings", &pattern_type,
"interpret patterns as fixed strings", N_("interpret patterns as fixed strings"),
pattern_type_fixed), pattern_type_fixed),
OPT_SET_INT('P', "perl-regexp", &pattern_type, OPT_SET_INT('P', "perl-regexp", &pattern_type,
"use Perl-compatible regular expressions", N_("use Perl-compatible regular expressions"),
pattern_type_pcre), pattern_type_pcre),
OPT_GROUP(""), OPT_GROUP(""),
OPT_BOOLEAN('n', "line-number", &opt.linenum, "show line numbers"), OPT_BOOLEAN('n', "line-number", &opt.linenum, N_("show line numbers")),
OPT_NEGBIT('h', NULL, &opt.pathname, "don't show filenames", 1), OPT_NEGBIT('h', NULL, &opt.pathname, N_("don't show filenames"), 1),
OPT_BIT('H', NULL, &opt.pathname, "show filenames", 1), OPT_BIT('H', NULL, &opt.pathname, N_("show filenames"), 1),
OPT_NEGBIT(0, "full-name", &opt.relative, OPT_NEGBIT(0, "full-name", &opt.relative,
"show filenames relative to top directory", 1), N_("show filenames relative to top directory"), 1),
OPT_BOOLEAN('l', "files-with-matches", &opt.name_only, OPT_BOOLEAN('l', "files-with-matches", &opt.name_only,
"show only filenames instead of matching lines"), N_("show only filenames instead of matching lines")),
OPT_BOOLEAN(0, "name-only", &opt.name_only, OPT_BOOLEAN(0, "name-only", &opt.name_only,
"synonym for --files-with-matches"), N_("synonym for --files-with-matches")),
OPT_BOOLEAN('L', "files-without-match", OPT_BOOLEAN('L', "files-without-match",
&opt.unmatch_name_only, &opt.unmatch_name_only,
"show only the names of files without match"), N_("show only the names of files without match")),
OPT_BOOLEAN('z', "null", &opt.null_following_name, OPT_BOOLEAN('z', "null", &opt.null_following_name,
"print NUL after filenames"), N_("print NUL after filenames")),
OPT_BOOLEAN('c', "count", &opt.count, OPT_BOOLEAN('c', "count", &opt.count,
"show the number of matches instead of matching lines"), N_("show the number of matches instead of matching lines")),
OPT__COLOR(&opt.color, "highlight matches"), OPT__COLOR(&opt.color, N_("highlight matches")),
OPT_BOOLEAN(0, "break", &opt.file_break, OPT_BOOLEAN(0, "break", &opt.file_break,
"print empty line between matches from different files"), N_("print empty line between matches from different files")),
OPT_BOOLEAN(0, "heading", &opt.heading, OPT_BOOLEAN(0, "heading", &opt.heading,
"show filename only once above matches from same file"), N_("show filename only once above matches from same file")),
OPT_GROUP(""), OPT_GROUP(""),
OPT_CALLBACK('C', "context", &opt, "n", OPT_CALLBACK('C', "context", &opt, N_("n"),
"show <n> context lines before and after matches", N_("show <n> context lines before and after matches"),
context_callback), context_callback),
OPT_INTEGER('B', "before-context", &opt.pre_context, OPT_INTEGER('B', "before-context", &opt.pre_context,
"show <n> context lines before matches"), N_("show <n> context lines before matches")),
OPT_INTEGER('A', "after-context", &opt.post_context, OPT_INTEGER('A', "after-context", &opt.post_context,
"show <n> context lines after matches"), N_("show <n> context lines after matches")),
OPT_NUMBER_CALLBACK(&opt, "shortcut for -C NUM", OPT_NUMBER_CALLBACK(&opt, N_("shortcut for -C NUM"),
context_callback), context_callback),
OPT_BOOLEAN('p', "show-function", &opt.funcname, OPT_BOOLEAN('p', "show-function", &opt.funcname,
"show a line with the function name before matches"), N_("show a line with the function name before matches")),
OPT_BOOLEAN('W', "function-context", &opt.funcbody, OPT_BOOLEAN('W', "function-context", &opt.funcbody,
"show the surrounding function"), N_("show the surrounding function")),
OPT_GROUP(""), OPT_GROUP(""),
OPT_CALLBACK('f', NULL, &opt, "file", OPT_CALLBACK('f', NULL, &opt, N_("file"),
"read patterns from file", file_callback), N_("read patterns from file"), file_callback),
{ OPTION_CALLBACK, 'e', NULL, &opt, "pattern", { OPTION_CALLBACK, 'e', NULL, &opt, N_("pattern"),
"match <pattern>", PARSE_OPT_NONEG, pattern_callback }, N_("match <pattern>"), PARSE_OPT_NONEG, pattern_callback },
{ OPTION_CALLBACK, 0, "and", &opt, NULL, { OPTION_CALLBACK, 0, "and", &opt, NULL,
"combine patterns specified with -e", N_("combine patterns specified with -e"),
PARSE_OPT_NOARG | PARSE_OPT_NONEG, and_callback }, PARSE_OPT_NOARG | PARSE_OPT_NONEG, and_callback },
OPT_BOOLEAN(0, "or", &dummy, ""), OPT_BOOLEAN(0, "or", &dummy, ""),
{ OPTION_CALLBACK, 0, "not", &opt, NULL, "", { OPTION_CALLBACK, 0, "not", &opt, NULL, "",
@ -769,16 +769,16 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
PARSE_OPT_NOARG | PARSE_OPT_NONEG | PARSE_OPT_NODASH, PARSE_OPT_NOARG | PARSE_OPT_NONEG | PARSE_OPT_NODASH,
close_callback }, close_callback },
OPT__QUIET(&opt.status_only, OPT__QUIET(&opt.status_only,
"indicate hit with exit status without output"), N_("indicate hit with exit status without output")),
OPT_BOOLEAN(0, "all-match", &opt.all_match, OPT_BOOLEAN(0, "all-match", &opt.all_match,
"show only matches from files that match all patterns"), N_("show only matches from files that match all patterns")),
OPT_GROUP(""), OPT_GROUP(""),
{ OPTION_STRING, 'O', "open-files-in-pager", &show_in_pager, { OPTION_STRING, 'O', "open-files-in-pager", &show_in_pager,
"pager", "show matching files in the pager", N_("pager"), N_("show matching files in the pager"),
PARSE_OPT_OPTARG, NULL, (intptr_t)default_pager }, PARSE_OPT_OPTARG, NULL, (intptr_t)default_pager },
OPT_BOOLEAN(0, "ext-grep", &external_grep_allowed__ignored, OPT_BOOLEAN(0, "ext-grep", &external_grep_allowed__ignored,
"allow calling of grep(1) (ignored by this build)"), N_("allow calling of grep(1) (ignored by this build)")),
{ OPTION_CALLBACK, 0, "help-all", &options, NULL, "show usage", { OPTION_CALLBACK, 0, "help-all", &options, NULL, N_("show usage"),
PARSE_OPT_HIDDEN | PARSE_OPT_NOARG, help_callback }, PARSE_OPT_HIDDEN | PARSE_OPT_NOARG, help_callback },
OPT_END() OPT_END()
}; };