path: root/builtin/add.c
diff options
authorRené Scharfe <>2018-08-02 19:17:35 (GMT)
committerJunio C Hamano <>2018-08-03 15:36:20 (GMT)
commit8b5ebbed0e793f6fcf92100e600b7a4bdd6452e9 (patch)
tree5b9abca72412b0a2603ef75fc4bc975b044e07a8 /builtin/add.c
parentc67318ecb6ddef6b9ecf59a422c4a282594e602d (diff)
add, update-index: fix --chmod argument help
Don't translate the argument specification for --chmod; "+x" and "-x" are the literal strings that the commands accept. Separate alternatives using a pipe character instead of a slash, for consistency. Use the flag PARSE_OPT_LITERAL_ARGHELP to prevent parseopt from adding a pair of angular brackets around the argument help string, as that would wrongly indicate that users need to replace the literal strings with some kind of value. Signed-off-by: Rene Scharfe <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/add.c')
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/add.c b/builtin/add.c
index bf01d89..110f2ae 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -306,7 +306,9 @@ static struct option builtin_add_options[] = {
OPT_BOOL( 0 , "refresh", &refresh_only, N_("don't add, only refresh the index")),
OPT_BOOL( 0 , "ignore-errors", &ignore_add_errors, N_("just skip files which cannot be added because of errors")),
OPT_BOOL( 0 , "ignore-missing", &ignore_missing, N_("check if - even missing - files are ignored in dry run")),
- OPT_STRING( 0 , "chmod", &chmod_arg, N_("(+/-)x"), N_("override the executable bit of the listed files")),
+ { OPTION_STRING, 0, "chmod", &chmod_arg, "(+|-)x",
+ N_("override the executable bit of the listed files"),
OPT_HIDDEN_BOOL(0, "warn-embedded-repo", &warn_on_embedded_repo,
N_("warn when adding an embedded repository")),