mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
Added auto completion for git-note
This commit is contained in:
parent
434f3bc05c
commit
4f4ab08339
1 changed files with 18 additions and 0 deletions
18
plugins/git-note/git-note.plugin.zsh
Normal file
18
plugins/git-note/git-note.plugin.zsh
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#compdef git
|
||||
__git_branch_names() {
|
||||
local expl
|
||||
declare -a branch_names
|
||||
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
|
||||
__git_command_successful || return
|
||||
_wanted branch-names expl branch-name compadd $* - $branch_names
|
||||
}
|
||||
|
||||
_git-note() {
|
||||
_arguments '-b :branch-name:__git_branch_names [branch to attach note to]' \
|
||||
'-l[list all branches with notes]' \
|
||||
'-v[also show branches without notes]'
|
||||
}
|
||||
|
||||
zstyle ':completion:*:*:git:*' user-commands \
|
||||
note:'add a note to branch' \
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue