git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Jean-Noël Avila via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: "Jean-Noël Avila" <jn.avila@free.fr>,
	"Jean-Noël Avila" <jn.avila@free.fr>
Subject: [PATCH 06/10] i18n: factorize "--foo requires --bar" and the like
Date: Fri, 03 Dec 2021 07:01:45 +0000	[thread overview]
Message-ID: <653e33f799531ccdc21212238c2f404ccf9e970c.1638514910.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1088.git.1638514909.gitgitgadget@gmail.com>

From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
---
 archive.c             | 2 +-
 builtin/add.c         | 4 ++--
 builtin/checkout.c    | 2 +-
 builtin/commit.c      | 2 +-
 builtin/fast-export.c | 2 +-
 builtin/index-pack.c  | 2 +-
 builtin/log.c         | 2 +-
 builtin/reset.c       | 4 ++--
 builtin/rm.c          | 2 +-
 builtin/stash.c       | 2 +-
 builtin/worktree.c    | 2 +-
 fetch-pack.c          | 2 +-
 http-fetch.c          | 4 ++--
 13 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/archive.c b/archive.c
index f1208beacff..0d96217b4d4 100644
--- a/archive.c
+++ b/archive.c
@@ -577,7 +577,7 @@ static int parse_archive_args(int argc, const char **argv,
 	if (remote)
 		die(_("Unexpected option --remote"));
 	if (exec)
-		die(_("Option --exec can only be used together with --remote"));
+		die(_("%s requires %s"), "--exec", "--remote");
 	if (output)
 		die(_("Unexpected option --output"));
 	if (is_remote && args->extra_files.nr)
diff --git a/builtin/add.c b/builtin/add.c
index de1547b3dcd..1be22f8c287 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -544,7 +544,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 		die(_("%s and %s are mutually exclusive"), "-A", "-u");
 
 	if (!show_only && ignore_missing)
-		die(_("Option --ignore-missing can only be used together with --dry-run"));
+		die(_("%s requires %s"), "--ignore-missing", "--dry-run");
 
 	if (chmod_arg && ((chmod_arg[0] != '-' && chmod_arg[0] != '+') ||
 			  chmod_arg[1] != 'x' || chmod_arg[2]))
@@ -576,7 +576,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 				    PATHSPEC_SYMLINK_LEADING_PATH,
 				    prefix, pathspec_from_file, pathspec_file_nul);
 	} else if (pathspec_file_nul) {
-		die(_("--pathspec-file-nul requires --pathspec-from-file"));
+		die(_("%s requires %s"), "--pathspec-file-nul", "--pathspec-from-file");
 	}
 
 	if (require_pathspec && pathspec.nr == 0) {
diff --git a/builtin/checkout.c b/builtin/checkout.c
index ca444e9c177..825e753f607 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -1740,7 +1740,7 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
 				    0,
 				    prefix, opts->pathspec_from_file, opts->pathspec_file_nul);
 	} else if (opts->pathspec_file_nul) {
-		die(_("--pathspec-file-nul requires --pathspec-from-file"));
+		die(_("%s requires %s"), "--pathspec-file-nul", "--pathspec-from-file");
 	}
 
 	opts->pathspec.recursive = 1;
diff --git a/builtin/commit.c b/builtin/commit.c
index cb7b9a38daa..37e8cf09bd5 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -367,7 +367,7 @@ static const char *prepare_index(const char **argv, const char *prefix,
 				    PATHSPEC_PREFER_FULL,
 				    prefix, pathspec_from_file, pathspec_file_nul);
 	} else if (pathspec_file_nul) {
-		die(_("--pathspec-file-nul requires --pathspec-from-file"));
+		die(_("%s requires %s"), "--pathspec-file-nul", "--pathspec-from-file");
 	}
 
 	if (!pathspec.nr && (also || (only && !allow_empty &&
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 31157e966d6..b0302a75374 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -1254,7 +1254,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
 		usage_with_options (fast_export_usage, options);
 
 	if (anonymized_seeds.cmpfn && !anonymize)
-		die(_("--anonymize-map without --anonymize does not make sense"));
+		die(_("%s requires %s"), "--anonymize-map", "--anonymize");
 
 	if (refspecs_list.nr) {
 		int i;
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index f9b40349f41..ed16230fa99 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1845,7 +1845,7 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
 	if (!pack_name && !from_stdin)
 		usage(index_pack_usage);
 	if (fix_thin_pack && !from_stdin)
-		die(_("--fix-thin cannot be used without --stdin"));
+		die(_("%s requires %s"), "--fix-thin", "--stdin");
 	if (from_stdin && !startup_info->have_repository)
 		die(_("--stdin requires a git repository"));
 	if (from_stdin && hash_algo)
diff --git a/builtin/log.c b/builtin/log.c
index c39b974ea37..ea54576f38b 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -2097,7 +2097,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 	if (creation_factor < 0)
 		creation_factor = RANGE_DIFF_CREATION_FACTOR_DEFAULT;
 	else if (!rdiff_prev)
-		die(_("--creation-factor requires --range-diff"));
+		die(_("%s requires %s"), "--creation-factor", "--range-diff");
 
 	if (rdiff_prev) {
 		if (!cover_letter && total != 1)
diff --git a/builtin/reset.c b/builtin/reset.c
index 6e80e5c5a51..7efa95e0529 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -337,7 +337,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 				    PATHSPEC_PREFER_FULL,
 				    prefix, pathspec_from_file, pathspec_file_nul);
 	} else if (pathspec_file_nul) {
-		die(_("--pathspec-file-nul requires --pathspec-from-file"));
+		die(_("%s requires %s"), "--pathspec-file-nul", "--pathspec-from-file");
 	}
 
 	unborn = !strcmp(rev, "HEAD") && get_oid("HEAD", &oid);
@@ -395,7 +395,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 		    _(reset_type_names[reset_type]));
 
 	if (intent_to_add && reset_type != MIXED)
-		die(_("-N can only be used with --mixed"));
+		die(_("%s requires %s"), "-N", "--mixed");
 
 	/* Soft reset does not touch the index file nor the working tree
 	 * at all, but requires them in a good order.  Other resets reset
diff --git a/builtin/rm.c b/builtin/rm.c
index 3d0967cdc11..38ac3c71252 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -278,7 +278,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 				    PATHSPEC_PREFER_CWD,
 				    prefix, pathspec_from_file, pathspec_file_nul);
 	} else if (pathspec_file_nul) {
-		die(_("--pathspec-file-nul requires --pathspec-from-file"));
+		die(_("%s requires %s"), "--pathspec-file-nul", "--pathspec-from-file");
 	}
 
 	if (!pathspec.nr)
diff --git a/builtin/stash.c b/builtin/stash.c
index 080572cc608..84a0a4667e6 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -1653,7 +1653,7 @@ static int push_stash(int argc, const char **argv, const char *prefix,
 				    PATHSPEC_PREFER_FULL | PATHSPEC_PREFIX_ORIGIN,
 				    prefix, pathspec_from_file, pathspec_file_nul);
 	} else if (pathspec_file_nul) {
-		die(_("--pathspec-file-nul requires --pathspec-from-file"));
+		die(_("%s requires %s"), "--pathspec-file-nul", "--pathspec-from-file");
 	}
 
 	return do_push_stash(&ps, stash_msg, quiet, keep_index, patch_mode,
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 73ee505234c..c6d64dc8dfa 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -506,7 +506,7 @@ static int add(int ac, const char **av, const char *prefix)
 	if (!!opts.detach + !!new_branch + !!new_branch_force > 1)
 		die(_("%s, %s and %s are mutually exclusive"), "-b", "-B", "--detach");
 	if (lock_reason && !keep_locked)
-		die(_("--reason requires --lock"));
+		die(_("%s requires %s"), "--reason", "--lock");
 	if (lock_reason)
 		opts.keep_locked = lock_reason;
 	else if (keep_locked)
diff --git a/fetch-pack.c b/fetch-pack.c
index a9604f35a3e..0bdef8877c1 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -296,7 +296,7 @@ static int find_common(struct fetch_negotiator *negotiator,
 	struct packet_reader reader;
 
 	if (args->stateless_rpc && multi_ack == 1)
-		die(_("--stateless-rpc requires multi_ack_detailed"));
+		die(_("%s requires %s"), "--stateless-rpc", "multi_ack_detailed");
 
 	packet_reader_init(&reader, fd[0], NULL, 0,
 			   PACKET_READ_CHOMP_NEWLINE |
diff --git a/http-fetch.c b/http-fetch.c
index fa642462a9e..68cbfc1979d 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -131,7 +131,7 @@ int cmd_main(int argc, const char **argv)
 
 	if (packfile) {
 		if (!index_pack_args.nr)
-			die(_("--packfile requires --index-pack-args"));
+			die(_("%s requires %s"), "--packfile", "--index-pack-args");
 
 		fetch_single_packfile(&packfile_hash, argv[arg],
 				      index_pack_args.v);
@@ -140,7 +140,7 @@ int cmd_main(int argc, const char **argv)
 	}
 
 	if (index_pack_args.nr)
-		die(_("--index-pack-args can only be used with --packfile"));
+		die(_("%s requires %s"), "--index-pack-args", "--packfile");
 
 	if (commits_on_stdin) {
 		commits = walker_targets_stdin(&commit_id, &write_ref);
-- 
gitgitgadget


  parent reply	other threads:[~2021-12-03  7:02 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03  7:01 [PATCH 00/10] Factorization of messages with similar meaning Jean-Noël Avila via GitGitGadget
2021-12-03  7:01 ` [PATCH 01/10] i18n: refactor "foo and bar are mutually exclusive" Jean-Noël Avila via GitGitGadget
2021-12-07 18:07   ` Ævar Arnfjörð Bjarmason
2021-12-08 18:13     ` Jean-Noël AVILA
2021-12-03  7:01 ` [PATCH 02/10] i18n: refactor "%s, %s and %s " Jean-Noël Avila via GitGitGadget
2021-12-03  7:01 ` [PATCH 03/10] i18n: turn "options are incompatible" into "are " Jean-Noël Avila via GitGitGadget
2021-12-03  7:01 ` [PATCH 04/10] i18n: standardize "cannot open" and "cannot read" Jean-Noël Avila via GitGitGadget
2021-12-07 18:09   ` Ævar Arnfjörð Bjarmason
2021-12-03  7:01 ` [PATCH 05/10] i18n: tag.c factorize i18n strings Jean-Noël Avila via GitGitGadget
2021-12-07 18:10   ` Ævar Arnfjörð Bjarmason
2021-12-03  7:01 ` Jean-Noël Avila via GitGitGadget [this message]
2021-12-03  7:01 ` [PATCH 07/10] i18n: factorize "no directory given for --foo" Jean-Noël Avila via GitGitGadget
2021-12-03  7:01 ` [PATCH 08/10] i18n: refactor "unrecognized %(foo) argument" strings Jean-Noël Avila via GitGitGadget
2021-12-07 18:15   ` Ævar Arnfjörð Bjarmason
2021-12-03  7:01 ` [PATCH 09/10] i18n: factorize "--foo outside a repository" Jean-Noël Avila via GitGitGadget
2021-12-03  7:01 ` [PATCH 10/10] i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom" Jean-Noël Avila via GitGitGadget
2021-12-03 21:55 ` [PATCH 00/10] Factorization of messages with similar meaning Jeff King
2021-12-03 23:39   ` Johannes Sixt
2021-12-05  7:31     ` Junio C Hamano
2021-12-05 17:25       ` Jean-Noël AVILA
2021-12-05 19:50         ` Johannes Sixt
2021-12-06 19:18           ` Junio C Hamano
2021-12-05 19:30 ` Junio C Hamano
2021-12-27 23:23 ` [PATCH v2 00/11] " Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 01/11] i18n: refactor "foo and bar are mutually exclusive" Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 02/11] i18n: refactor "%s, %s and %s " Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 03/11] i18n: turn "options are incompatible" into "cannot be used together" Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 04/11] i18n: standardize "cannot open" and "cannot read" Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 05/11] i18n: tag.c factorize i18n strings Jean-Noël Avila via GitGitGadget
2021-12-27 23:42     ` Junio C Hamano
2021-12-27 23:45       ` Ævar Arnfjörð Bjarmason
2021-12-28  0:16         ` Junio C Hamano
2021-12-29 14:05           ` Jean-Noël AVILA
2021-12-27 23:23   ` [PATCH v2 06/11] i18n: factorize "--foo requires --bar" and the like Jean-Noël Avila via GitGitGadget
2021-12-28  7:01     ` Johannes Sixt
2021-12-29 14:02       ` Jean-Noël AVILA
2021-12-27 23:23   ` [PATCH v2 07/11] i18n: factorize "no directory given for --foo" Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 08/11] i18n: refactor "unrecognized %(foo) argument" strings Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 09/11] i18n: factorize "--foo outside a repository" Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 10/11] i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom" Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 11/11] i18n: turn even more messages into "cannot be used together" ones Jean-Noël Avila via GitGitGadget
2021-12-28  7:33     ` Johannes Sixt
2021-12-29 15:49       ` Jean-Noël AVILA
2021-12-29 18:54   ` [PATCH v3 00/11] Factorization of messages with similar meaning Jean-Noël Avila via GitGitGadget
2021-12-29 18:54     ` [PATCH v3 01/11] i18n: refactor "foo and bar are mutually exclusive" Jean-Noël Avila via GitGitGadget
2021-12-29 18:54     ` [PATCH v3 02/11] i18n: refactor "%s, %s and %s " Jean-Noël Avila via GitGitGadget
2021-12-30 22:26       ` Junio C Hamano
2021-12-31 17:05         ` Jean-Noël AVILA
2021-12-29 18:54     ` [PATCH v3 03/11] i18n: turn "options are incompatible" into "cannot be used together" Jean-Noël Avila via GitGitGadget
2021-12-29 19:36       ` Johannes Sixt
2021-12-30 16:52         ` Jean-Noël AVILA
2021-12-30 22:36           ` Junio C Hamano
2021-12-29 18:55     ` [PATCH v3 04/11] i18n: standardize "cannot open" and "cannot read" Jean-Noël Avila via GitGitGadget
2021-12-29 18:55     ` [PATCH v3 05/11] i18n: tag.c factorize i18n strings Jean-Noël Avila via GitGitGadget
2022-01-01 14:14       ` René Scharfe
2021-12-29 18:55     ` [PATCH v3 06/11] i18n: factorize "--foo requires --bar" and the like Jean-Noël Avila via GitGitGadget
2021-12-29 18:55     ` [PATCH v3 07/11] i18n: factorize "no directory given for --foo" Jean-Noël Avila via GitGitGadget
2021-12-30 22:36       ` Junio C Hamano
2021-12-29 18:55     ` [PATCH v3 08/11] i18n: refactor "unrecognized %(foo) argument" strings Jean-Noël Avila via GitGitGadget
2021-12-29 18:55     ` [PATCH v3 09/11] i18n: factorize "--foo outside a repository" Jean-Noël Avila via GitGitGadget
2021-12-29 18:55     ` [PATCH v3 10/11] i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom" Jean-Noël Avila via GitGitGadget
2021-12-29 18:55     ` [PATCH v3 11/11] i18n: turn even more messages into "cannot be used together" ones Jean-Noël Avila via GitGitGadget
2021-12-30 22:36       ` Junio C Hamano
2021-12-31 17:16         ` Jean-Noël AVILA
2022-01-03 21:51           ` Junio C Hamano
2022-01-02 17:15     ` [PATCH v4 00/11] Factorization of messages with similar meaning Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 01/11] i18n: refactor "foo and bar are mutually exclusive" Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 02/11] i18n: refactor "%s, %s and %s " Jean-Noël Avila via GitGitGadget
2022-01-03 15:44         ` Johannes Sixt
2022-01-02 17:15       ` [PATCH v4 03/11] i18n: turn "options are incompatible" into "cannot be used together" Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 04/11] i18n: standardize "cannot open" and "cannot read" Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 05/11] i18n: tag.c factorize i18n strings Jean-Noël Avila via GitGitGadget
2022-01-02 17:37         ` René Scharfe
2022-01-02 20:29           ` Jean-Noël AVILA
2022-01-02 17:15       ` [PATCH v4 06/11] i18n: factorize "--foo requires --bar" and the like Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 07/11] i18n: factorize "no directory given for --foo" Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 08/11] i18n: refactor "unrecognized %(foo) argument" strings Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 09/11] i18n: factorize "--foo outside a repository" Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 10/11] i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom" Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 11/11] i18n: turn even more messages into "cannot be used together" ones Jean-Noël Avila via GitGitGadget
2022-01-05 20:02       ` [PATCH v5 00/11] Factorization of messages with similar meaning Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 01/11] i18n: refactor "foo and bar are mutually exclusive" Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 02/11] i18n: refactor "%s, %s and %s " Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 03/11] i18n: turn "options are incompatible" into "cannot be used together" Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 04/11] i18n: standardize "cannot open" and "cannot read" Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 05/11] i18n: tag.c factorize i18n strings Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 06/11] i18n: factorize "--foo requires --bar" and the like Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 07/11] i18n: factorize "no directory given for --foo" Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 08/11] i18n: refactor "unrecognized %(foo) argument" strings Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 09/11] i18n: factorize "--foo outside a repository" Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 10/11] i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom" Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 11/11] i18n: turn even more messages into "cannot be used together" ones Jean-Noël Avila via GitGitGadget
2022-01-05 20:58         ` [PATCH v5 00/11] Factorization of messages with similar meaning Johannes Sixt
2022-01-05 21:31           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=653e33f799531ccdc21212238c2f404ccf9e970c.1638514910.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jn.avila@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).