From ebc4a04e8437e704e40a1d35aea030dc03ec8e56 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Fri, 9 Feb 2018 18:02:12 +0700 Subject: remote: force completing --mirror= instead of --mirror MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "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 Signed-off-by: Junio C Hamano --- parse-options.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'parse-options.c') diff --git a/parse-options.c b/parse-options.c index 29f4defdd6..979577ba2c 100644 --- a/parse-options.c +++ b/parse-options.c @@ -459,6 +459,8 @@ static int show_gitcomp(struct parse_opt_ctx_t *ctx, default: break; } + if (opts->flags & PARSE_OPT_COMP_ARG) + suffix = "="; printf(" --%s%s", opts->long_name, suffix); } fputc('\n', stdout); -- cgit v1.3