From: Oleg Broytman Date: Thu, 7 Jul 2016 15:30:10 +0000 (+0300) Subject: .shellrc: define completion for git-open - list remotes with http(s) URLs X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=ed7cdee7b186fee9d99410d77ef722add83e4a32;p=dotfiles.git .shellrc: define completion for git-open - list remotes with http(s) URLs --- diff --git a/.shellrc b/.shellrc index d0c9c37..38f7381 100644 --- a/.shellrc +++ b/.shellrc @@ -195,6 +195,17 @@ case "$SHELL" in } complete -F _cdremote_complete cdremote + + # define completion for git-open - list remotes with http(s) URLs + _git_open() { + local cur="${COMP_WORDS[COMP_CWORD]}"; + list_remotes '^http\(s\)\?://' + COMPREPLY=(`compgen -W "$GIT_REMOTES" -- "$cur"`) + GIT_REMOTES="" + unset GIT_REMOTES + } + + complete -F _git_open git-open ;; esac