Add worktree find <glob> to find in all worktrees

This commit is contained in:
2026-09-07 14:58:08 +01:00
parent 9aba1adce8
commit 538f90083b
2 changed files with 184 additions and 32 deletions

View File

@@ -36,6 +36,7 @@ _worktree() {
local commands; commands=(
'add:Create a worktree for a branch'
'cd:Change directory to a worktree by branch'
'find:Find a path in every worktree'
'list:List managed worktrees'
'ls:List managed worktrees'
'remove:Remove a worktree by branch'
@@ -53,6 +54,11 @@ _worktree() {
(cd)
_arguments '1:: :__worktree_all_branches'
;;
(find)
_arguments \
'(-i --ignore-case)'{-i,--ignore-case}'[Match the glob case insensitively]' \
'1:: :_files'
;;
(rm|remove)
_arguments \
'(-f --force)'{-f,--force}'[Force removal even with modified or untracked files]' \