summaryrefslogtreecommitdiff
path: root/parse-options.h
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-02-09 11:02:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-02-09 18:24:52 (GMT)
commitebc4a04e8437e704e40a1d35aea030dc03ec8e56 (patch)
tree28631a3703f8e2a1c9167f7c243241bd915902bd /parse-options.h
parentab6a11c580f50ac37d436510fa4c6984c588f85f (diff)
downloadgit-ebc4a04e8437e704e40a1d35aea030dc03ec8e56.zip
git-ebc4a04e8437e704e40a1d35aea030dc03ec8e56.tar.gz
git-ebc4a04e8437e704e40a1d35aea030dc03ec8e56.tar.bz2
remote: force completing --mirror= instead of --mirror
"git remote --mirror" is a special case. Technically it is possible to specify --mirror without any argument. But we will get a "dangerous, deprecated!" warning in that case. This new parse-opt flag allows --git-completion-helper to always complete --mirror=, ignoring the dangerous use case. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'parse-options.h')
-rw-r--r--parse-options.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/parse-options.h b/parse-options.h
index 009cd86..0ba0869 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -39,7 +39,8 @@ enum parse_opt_option_flags {
PARSE_OPT_NODASH = 32,
PARSE_OPT_LITERAL_ARGHELP = 64,
PARSE_OPT_SHELL_EVAL = 256,
- PARSE_OPT_NOCOMPLETE = 512
+ PARSE_OPT_NOCOMPLETE = 512,
+ PARSE_OPT_COMP_ARG = 1024
};
struct option;
@@ -92,6 +93,9 @@ typedef int parse_opt_ll_cb(struct parse_opt_ctx_t *ctx,
* Useful for options with multiple parameters.
* PARSE_OPT_NOCOMPLETE: by default all visible options are completable
* by git-completion.bash. This option suppresses that.
+ * PARSE_OPT_COMP_ARG: this option forces to git-completion.bash to
+ * complete an option as --name= not --name even if
+ * the option takes optional argument.
*
* `callback`::
* pointer to the callback to use for OPTION_CALLBACK or