diff --git a/etc/git-extras-completion.zsh b/etc/git-extras-completion.zsh index 05f271b..9e1c18d 100644 --- a/etc/git-extras-completion.zsh +++ b/etc/git-extras-completion.zsh @@ -92,6 +92,13 @@ __gitex_submodule_names() { _wanted submodule-names expl submodule-name compadd $* - $submodule_names } +__gitex_workspace_names() { + local expl + declare -a workspace_names + workspace_names=($(git bulk --listall | awk '{print $1}' | cut -d "." -f 2)) + __gitex_command_successful || return + _wanted workspace-names expl workspace-names compadd $* - $workspace_names +} __gitex_author_names() { local expl @@ -122,6 +129,20 @@ _git-brv() { '(-r --reverse)'{-r,--reverse}'[reverse order]' } +_git-bulk() { + _arguments \ + '-a[Run a git command on all workspaces and their repositories.]' \ + '-g[Ask the user for confirmation on every execution (guarded mode).]' \ + '-w[Run the git command on the specified workspace.]:workspace-name:__gitex_workspace_names' \ + '-q[Suppress bulk output about current execution (quiet mode).]' \ + '--addworkspace[Register a workspace for bulk operations.]' \ + '--removeworkspace[Remove the specified workspace.]:workspace-name:__gitex_workspace_names' \ + '--addcurrent[Adds the current directory as workspace to git bulk operations]' \ + '--purge[Removes all defined repository locations.]' \ + '--listall[List all registered repositories.]' \ + '--help[Show the help.]' +} + _git-changelog() { _arguments \ '(-l --list)'{-l,--list}'[list commits]' \