i18n: factorize more 'incompatible options' messages

Find more incompatible options to factorize.

When more than two options are mutually exclusive, print the ones
which are actually on the command line.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jean-Noël Avila
2022-01-31 22:07:46 +00:00
committed by Junio C Hamano
parent 5d01301f2b
commit a699367bb8
8 changed files with 79 additions and 32 deletions

View File

@ -159,12 +159,14 @@ int cmd_merge_base(int argc, const char **argv, const char *prefix)
if (argc < 2)
usage_with_options(merge_base_usage, options);
if (show_all)
die("--is-ancestor cannot be used with --all");
die(_("options '%s' and '%s' cannot be used together"),
"--is-ancestor", "--all");
return handle_is_ancestor(argc, argv);
}
if (cmdmode == 'r' && show_all)
die("--independent cannot be used with --all");
die(_("options '%s' and '%s' cannot be used together"),
"--independent", "--all");
if (cmdmode == 'o')
return handle_octopus(argc, argv, show_all);