Message ID | 0102017015765b98-e2e26f61-dd07-4a32-a72f-2d7b2159fffe-000000@eu-west-1.amazonses.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | parse-options: lose an unnecessary space in an error message | expand |
Jacques Bodin-Hullin <j.bodinhullin@monsieurbiz.com> writes: > Signed-off-by: Jacques Bodin-Hullin <j.bodinhullin@monsieurbiz.com> > --- > parse-options.c | 4 ++-- > t/t0040-parse-options.sh | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/parse-options.c b/parse-options.c > index b42f54d48b96c..71dbe84d896b4 100644 > --- a/parse-options.c > +++ b/parse-options.c > @@ -420,7 +420,7 @@ static void check_typos(const char *arg, const struct option *options) > return; > > if (starts_with(arg, "no-")) { > - error(_("did you mean `--%s` (with two dashes ?)"), arg); > + error(_("did you mean `--%s` (with two dashes)?"), arg); Makes sense. Not just there is an extra SP before the question mark, the question mark is about the whole sentence, so pushing it out of the parentheses also is a good change. We might even want to lose the parentheses altogether, i.e. did you mean `--%s` with two dashes? Hmm? Thanks.
Hi, Actually I prefer to keep the parentheses, it makes better sense to me. It feels correct with them when I speak it loudly, incorrect without. BR, Jacques
diff --git a/parse-options.c b/parse-options.c index b42f54d48b96c..71dbe84d896b4 100644 --- a/parse-options.c +++ b/parse-options.c @@ -420,7 +420,7 @@ static void check_typos(const char *arg, const struct option *options) return; 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); } @@ -428,7 +428,7 @@ static void check_typos(const char *arg, const struct option *options) if (!options->long_name) continue; 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); } } diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh index 705a136ed92c9..9d7c7fdaa2af1 100755 --- a/t/t0040-parse-options.sh +++ b/t/t0040-parse-options.sh @@ -242,7 +242,7 @@ test_expect_success 'Alias options do not contribute to abbreviation' ' ' cat >typo.err <<\EOF -error: did you mean `--boolean` (with two dashes ?) +error: did you mean `--boolean` (with two dashes)? EOF test_expect_success 'detect possible typos' ' @@ -252,7 +252,7 @@ test_expect_success 'detect possible typos' ' ' cat >typo.err <<\EOF -error: did you mean `--ambiguous` (with two dashes ?) +error: did you mean `--ambiguous` (with two dashes)? EOF test_expect_success 'detect possible typos' '
Signed-off-by: Jacques Bodin-Hullin <j.bodinhullin@monsieurbiz.com> --- parse-options.c | 4 ++-- t/t0040-parse-options.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) -- https://github.com/git/git/pull/540