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>
This commit is contained in:
Nguyễn Thái Ngọc Duy
2018-02-09 18:02:12 +07:00
committed by Junio C Hamano
parent ab6a11c580
commit ebc4a04e84
3 changed files with 8 additions and 2 deletions

View File

@ -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);