diff mbox series

[v3,07/11] i18n: factorize "no directory given for --foo"

Message ID 4c17e08b9d3a42375c7082d5d2275ea8cc4fab99.1640804108.git.gitgitgadget@gmail.com (mailing list archive)
State Superseded
Headers show
Series Factorization of messages with similar meaning | expand

Commit Message

Jean-Noël Avila Dec. 29, 2021, 6:55 p.m. UTC
From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
---
 git.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Junio C Hamano Dec. 30, 2021, 10:36 p.m. UTC | #1
"Jean-Noël Avila via GitGitGadget"  <gitgitgadget@gmail.com> writes:

>  		} else if (!strcmp(cmd, "--git-dir")) {
>  			if (*argc < 2) {
> -				fprintf(stderr, _("no directory given for --git-dir\n" ));
> +				fprintf(stderr, _("no directory given for %s\n" ), "--git-dir");
>  				usage(git_usage_string);
>  			}
>  			setenv(GIT_DIR_ENVIRONMENT, (*argv)[1], 1);

None of the originals of these three uses it, but I wonder if we
want a single-quote-pair around %s.
diff mbox series

Patch

diff --git a/git.c b/git.c
index 7edafd8ecff..7e361769ff6 100644
--- a/git.c
+++ b/git.c
@@ -185,7 +185,7 @@  static int handle_options(const char ***argv, int *argc, int *envchanged)
 				*envchanged = 1;
 		} else if (!strcmp(cmd, "--git-dir")) {
 			if (*argc < 2) {
-				fprintf(stderr, _("no directory given for --git-dir\n" ));
+				fprintf(stderr, _("no directory given for %s\n" ), "--git-dir");
 				usage(git_usage_string);
 			}
 			setenv(GIT_DIR_ENVIRONMENT, (*argv)[1], 1);
@@ -213,7 +213,7 @@  static int handle_options(const char ***argv, int *argc, int *envchanged)
 				*envchanged = 1;
 		} else if (!strcmp(cmd, "--work-tree")) {
 			if (*argc < 2) {
-				fprintf(stderr, _("no directory given for --work-tree\n" ));
+				fprintf(stderr, _("no directory given for %s\n" ), "--work-tree");
 				usage(git_usage_string);
 			}
 			setenv(GIT_WORK_TREE_ENVIRONMENT, (*argv)[1], 1);
@@ -297,7 +297,7 @@  static int handle_options(const char ***argv, int *argc, int *envchanged)
 				*envchanged = 1;
 		} else if (!strcmp(cmd, "-C")) {
 			if (*argc < 2) {
-				fprintf(stderr, _("no directory given for -C\n" ));
+				fprintf(stderr, _("no directory given for %s\n" ), "-C");
 				usage(git_usage_string);
 			}
 			if ((*argv)[1][0]) {