i18n: factorize "no directory given for --foo"
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Reviewed-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jean-Noël Avila committed
Jan 5, 2022 at 20:02 UTC
986cd6556c000a460d499fafb7cd0a8d9220b57d
1 file changed
+3
-3
git.c
+3
-3
@@ -185,7 +185,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
185
*envchanged = 1;
186
} else if (!strcmp(cmd, "--git-dir")) {
187
if (*argc < 2) {
188
- fprintf(stderr, _("no directory given for --git-dir\n" ));
188
+ fprintf(stderr, _("no directory given for '%s' option\n" ), "--git-dir");
189
usage(git_usage_string);
190
}
191
setenv(GIT_DIR_ENVIRONMENT, (*argv)[1], 1);
@@ -213,7 +213,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
213
*envchanged = 1;
214
} else if (!strcmp(cmd, "--work-tree")) {
215
if (*argc < 2) {
216
- fprintf(stderr, _("no directory given for --work-tree\n" ));
216
+ fprintf(stderr, _("no directory given for '%s' option\n" ), "--work-tree");
217
usage(git_usage_string);
218
}
219
setenv(GIT_WORK_TREE_ENVIRONMENT, (*argv)[1], 1);
@@ -297,7 +297,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
297
*envchanged = 1;
298
} else if (!strcmp(cmd, "-C")) {
299
if (*argc < 2) {
300
- fprintf(stderr, _("no directory given for -C\n" ));
300
+ fprintf(stderr, _("no directory given for '%s' option\n" ), "-C");
301
usage(git_usage_string);
302
}
303
if ((*argv)[1][0]) {