1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-11 09:17:05 +02:00

Merge branch 'es/bugreport-no-extra-arg'

"git bugreport" learned to complain when it received a command line
argument that it will not use.

* es/bugreport-no-extra-arg:
  bugreport: reject positional arguments
  t0091-bugreport: stop using i18ngrep
This commit is contained in:
Junio C Hamano 2023-11-07 10:26:44 +09:00
commit 840bd1c9ef
2 changed files with 13 additions and 1 deletions

View File

@ -126,6 +126,11 @@ int cmd_bugreport(int argc, const char **argv, const char *prefix)
argc = parse_options(argc, argv, prefix, bugreport_options,
bugreport_usage, 0);
if (argc) {
error(_("unknown argument `%s'"), argv[0]);
usage(bugreport_usage[0]);
}
/* Prepare the path to put the result */
prefixed_filename = prefix_filename(prefix,
option_output ? option_output : "");

View File

@ -65,7 +65,14 @@ test_expect_success '--output-directory puts the report in the provided dir' '
test_expect_success 'incorrect arguments abort with usage' '
test_must_fail git bugreport --false 2>output &&
test_i18ngrep usage output &&
grep usage output &&
test_path_is_missing git-bugreport-*
'
test_expect_success 'incorrect positional arguments abort with usage and hint' '
test_must_fail git bugreport false 2>output &&
grep usage output &&
grep false output &&
test_path_is_missing git-bugreport-*
'