]> git.ipfire.org Git - thirdparty/git.git/commitdiff
completion: use __gitcomp_builtin in _git_worktree
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Fri, 9 Feb 2018 11:02:20 +0000 (18:02 +0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 9 Feb 2018 18:24:53 +0000 (10:24 -0800)
The new completable options for "worktree add" are:

--checkout
--guess-remote
--lock
--track

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/worktree.c
contrib/completion/git-completion.bash

index 4d3422f62e7e02bd9f4949e2704ac1cb8028ae3d..76dc6b8cb56ca85dcbab7a2e9ab539d3ff82749c 100644 (file)
@@ -367,7 +367,7 @@ static int add(int ac, const char **av, const char *prefix)
        struct option options[] = {
                OPT__FORCE(&opts.force,
                           N_("checkout <branch> even if already checked out in other worktree"),
-                          0),
+                          PARSE_OPT_NOCOMPLETE),
                OPT_STRING('b', NULL, &opts.new_branch, N_("branch"),
                           N_("create a new branch")),
                OPT_STRING('B', NULL, &new_branch_force, N_("branch"),
index e76b2f0356ac84224ae0affcfbb48a5ff75af604..0ddf40063b8a9f2cf6d9de26835edac6342467b5 100644 (file)
@@ -3021,16 +3021,16 @@ _git_worktree ()
        else
                case "$subcommand,$cur" in
                add,--*)
-                       __gitcomp "--detach"
+                       __gitcomp_builtin worktree_add
                        ;;
                list,--*)
-                       __gitcomp "--porcelain"
+                       __gitcomp_builtin worktree_list
                        ;;
                lock,--*)
-                       __gitcomp "--reason"
+                       __gitcomp_builtin worktree_lock
                        ;;
                prune,--*)
-                       __gitcomp "--dry-run --expire --verbose"
+                       __gitcomp_builtin worktree_prune
                        ;;
                *)
                        ;;