[PATCH v3 34/42] completion: use __gitcomp_builtin in _git_replace
From: Nguyễn Thái Ngọc Duy <hidden>
Date: 2018-02-09 11:05:43
Subsystem:
the rest · Maintainer:
Linus Torvalds
The new completable option is --raw. Signed-off-by: Nguyễn Thái Ngọc Duy <redacted> --- builtin/replace.c | 3 ++- contrib/completion/git-completion.bash | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/builtin/replace.c b/builtin/replace.c
index 10078ae371..0c1d8e1b08 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c@@ -439,7 +439,8 @@ int cmd_replace(int argc, const char **argv, const char *prefix) OPT_CMDMODE('d', "delete", &cmdmode, N_("delete replace refs"), MODE_DELETE), OPT_CMDMODE('e', "edit", &cmdmode, N_("edit existing object"), MODE_EDIT), OPT_CMDMODE('g', "graft", &cmdmode, N_("change a commit's parents"), MODE_GRAFT), - OPT_BOOL('f', "force", &force, N_("replace the ref if it exists")), + OPT_BOOL_F('f', "force", &force, N_("replace the ref if it exists"), + PARSE_OPT_NOCOMPLETE), OPT_BOOL(0, "raw", &raw, N_("do not pretty-print contents for --edit")), OPT_STRING(0, "format", &format, N_("format"), N_("use this format")), OPT_END()
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 6e600b7aa3..18c2ccece9 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash@@ -2661,7 +2661,7 @@ _git_replace () { case "$cur" in --*) - __gitcomp "--edit --graft --format= --list --delete" + __gitcomp_builtin replace return ;; esac
--
2.16.1.207.gedba492059