Skip to content

Commit 840bd1c

Browse files
committed
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
2 parents 9f7fbe0 + 681c0a2 commit 840bd1c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

builtin/bugreport.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ int cmd_bugreport(int argc, const char **argv, const char *prefix)
126126
argc = parse_options(argc, argv, prefix, bugreport_options,
127127
bugreport_usage, 0);
128128

129+
if (argc) {
130+
error(_("unknown argument `%s'"), argv[0]);
131+
usage(bugreport_usage[0]);
132+
}
133+
129134
/* Prepare the path to put the result */
130135
prefixed_filename = prefix_filename(prefix,
131136
option_output ? option_output : "");

t/t0091-bugreport.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,14 @@ test_expect_success '--output-directory puts the report in the provided dir' '
6565

6666
test_expect_success 'incorrect arguments abort with usage' '
6767
test_must_fail git bugreport --false 2>output &&
68-
test_i18ngrep usage output &&
68+
grep usage output &&
69+
test_path_is_missing git-bugreport-*
70+
'
71+
72+
test_expect_success 'incorrect positional arguments abort with usage and hint' '
73+
test_must_fail git bugreport false 2>output &&
74+
grep usage output &&
75+
grep false output &&
6976
test_path_is_missing git-bugreport-*
7077
'
7178

0 commit comments

Comments
 (0)