diff options
author | Jean-Noël Avila <jn.avila@free.fr> | 2022-02-01 01:07:46 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-02-05 00:58:28 +0300 |
commit | a699367bb8749a338aefb092c5d7ac75c69d61e1 (patch) | |
tree | c09bbd28e122a8a2b718fed0c41fbecd743ad8cf /builtin/grep.c | |
parent | 5d01301f2b865aa8dba1654d3f447ce9d21db0b5 (diff) |
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>
Diffstat (limited to 'builtin/grep.c')
-rw-r--r-- | builtin/grep.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/builtin/grep.c b/builtin/grep.c index 9e34a820ad..88144f0630 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -1167,11 +1167,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix) if (!show_in_pager && !opt.status_only) setup_pager(); - if (!use_index && (untracked || cached)) - die(_("--cached or --untracked cannot be used with --no-index")); - - if (untracked && cached) - die(_("--untracked cannot be used with --cached")); + die_for_incompatible_opt3(!use_index, "--no-index", + untracked, "--untracked", + cached, "--cached"); if (!use_index || untracked) { int use_exclude = (opt_exclude < 0) ? use_index : !!opt_exclude; |