diff --git a/worktree/worktree.plugin.zsh b/worktree/worktree.plugin.zsh index 923e22d..246ee6a 100644 --- a/worktree/worktree.plugin.zsh +++ b/worktree/worktree.plugin.zsh @@ -45,6 +45,7 @@ Manage git worktrees by branch name." _autoenv_authorized $wt_dest/.exit yes fi ;; + cd) if [[ -z "$branch" ]]; then print -P "%F{red}error:%f missing argument" @@ -59,6 +60,7 @@ Manage git worktrees by branch name." fi cd "$wt_path" ;; + list|ls) local root=$(git rev-parse --show-toplevel) local prefix="${root:h}/${root:t}@" @@ -67,6 +69,7 @@ Manage git worktrees by branch name." /^branch refs\/heads\//{ if(index(p, prefix)==1) { sub(/^branch refs\/heads\//, ""); print } } ' ;; + rm|remove) local force=0 local branches=() @@ -129,6 +132,7 @@ Manage git worktrees by branch name." done return $failed ;; + sync) local root=$(git rev-parse --show-toplevel) local prefix="${root:h}/${root:t}@" @@ -169,6 +173,7 @@ Manage git worktrees by branch name." done return $failed ;; + *) print -P "%F{red}error:%f unknown command: $cmd" return 1