зеркало из https://github.com/microsoft/git.git
parse-options.c: mark more strings for translation
One error is updated to start with lowercase to be consistent with the rest. 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:
Родитель
48a5499ef5
Коммит
8900342628
|
@ -319,8 +319,8 @@ is_abbreviated:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ambiguous_option) {
|
if (ambiguous_option) {
|
||||||
error("Ambiguous option: %s "
|
error(_("ambiguous option: %s "
|
||||||
"(could be --%s%s or --%s%s)",
|
"(could be --%s%s or --%s%s)"),
|
||||||
arg,
|
arg,
|
||||||
(ambiguous_flags & OPT_UNSET) ? "no-" : "",
|
(ambiguous_flags & OPT_UNSET) ? "no-" : "",
|
||||||
ambiguous_option->long_name,
|
ambiguous_option->long_name,
|
||||||
|
@ -353,7 +353,7 @@ static void check_typos(const char *arg, const struct option *options)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (starts_with(arg, "no-")) {
|
if (starts_with(arg, "no-")) {
|
||||||
error ("did you mean `--%s` (with two dashes ?)", arg);
|
error(_("did you mean `--%s` (with two dashes ?)"), arg);
|
||||||
exit(129);
|
exit(129);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ static void check_typos(const char *arg, const struct option *options)
|
||||||
if (!options->long_name)
|
if (!options->long_name)
|
||||||
continue;
|
continue;
|
||||||
if (starts_with(options->long_name, arg)) {
|
if (starts_with(options->long_name, arg)) {
|
||||||
error ("did you mean `--%s` (with two dashes ?)", arg);
|
error(_("did you mean `--%s` (with two dashes ?)"), arg);
|
||||||
exit(129);
|
exit(129);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -644,11 +644,11 @@ int parse_options(int argc, const char **argv, const char *prefix,
|
||||||
break;
|
break;
|
||||||
default: /* PARSE_OPT_UNKNOWN */
|
default: /* PARSE_OPT_UNKNOWN */
|
||||||
if (ctx.argv[0][1] == '-') {
|
if (ctx.argv[0][1] == '-') {
|
||||||
error("unknown option `%s'", ctx.argv[0] + 2);
|
error(_("unknown option `%s'"), ctx.argv[0] + 2);
|
||||||
} else if (isascii(*ctx.opt)) {
|
} else if (isascii(*ctx.opt)) {
|
||||||
error("unknown switch `%c'", *ctx.opt);
|
error(_("unknown switch `%c'"), *ctx.opt);
|
||||||
} else {
|
} else {
|
||||||
error("unknown non-ascii option in string: `%s'",
|
error(_("unknown non-ascii option in string: `%s'"),
|
||||||
ctx.argv[0]);
|
ctx.argv[0]);
|
||||||
}
|
}
|
||||||
usage_with_options(usagestr, options);
|
usage_with_options(usagestr, options);
|
||||||
|
|
|
@ -228,7 +228,7 @@ EOF
|
||||||
test_expect_success 'detect possible typos' '
|
test_expect_success 'detect possible typos' '
|
||||||
test_must_fail test-tool parse-options -boolean >output 2>output.err &&
|
test_must_fail test-tool parse-options -boolean >output 2>output.err &&
|
||||||
test_must_be_empty output &&
|
test_must_be_empty output &&
|
||||||
test_cmp typo.err output.err
|
test_i18ncmp typo.err output.err
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >typo.err <<\EOF
|
cat >typo.err <<\EOF
|
||||||
|
@ -238,7 +238,7 @@ EOF
|
||||||
test_expect_success 'detect possible typos' '
|
test_expect_success 'detect possible typos' '
|
||||||
test_must_fail test-tool parse-options -ambiguous >output 2>output.err &&
|
test_must_fail test-tool parse-options -ambiguous >output 2>output.err &&
|
||||||
test_must_be_empty output &&
|
test_must_be_empty output &&
|
||||||
test_cmp typo.err output.err
|
test_i18ncmp typo.err output.err
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'keep some options as arguments' '
|
test_expect_success 'keep some options as arguments' '
|
||||||
|
|
Загрузка…
Ссылка в новой задаче