i18n: factorize "invalid value" messages
Use the same message when an invalid value is passed to a command line option or a configuration variable. 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:

committed by
Junio C Hamano

parent
a699367bb8
commit
1a8aea857e
@ -199,7 +199,7 @@ static int am_option_parse_empty(const struct option *opt,
|
||||
else if (!strcmp(arg, "keep"))
|
||||
*opt_value = KEEP_EMPTY_COMMIT;
|
||||
else
|
||||
return error(_("Invalid value for --empty: %s"), arg);
|
||||
return error(_("invalid value for '%s': '%s'"), "--empty", arg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -2239,7 +2239,8 @@ static int parse_opt_patchformat(const struct option *opt, const char *arg, int
|
||||
* when you add new options
|
||||
*/
|
||||
else
|
||||
return error(_("Invalid value for --patch-format: %s"), arg);
|
||||
return error(_("invalid value for '%s': '%s'"),
|
||||
"--patch-format", arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2282,7 +2283,8 @@ static int parse_opt_show_current_patch(const struct option *opt, const char *ar
|
||||
break;
|
||||
}
|
||||
if (new_value >= ARRAY_SIZE(valid_modes))
|
||||
return error(_("Invalid value for --show-current-patch: %s"), arg);
|
||||
return error(_("invalid value for '%s': '%s'"),
|
||||
"--show-current-patch", arg);
|
||||
}
|
||||
|
||||
if (resume->mode == RESUME_SHOW_PATCH && new_value != resume->sub_mode)
|
||||
|
Reference in New Issue
Block a user