mirror of
https://github.com/x-motemen/ghq.git
synced 2026-09-12 16:36:17 -04:00
21 lines
415 B
Plaintext
21 lines
415 B
Plaintext
function _ghq () {
|
|
local cur prev words cword
|
|
_init_completion || return
|
|
|
|
case $cword in
|
|
1)
|
|
COMPREPLY=( $(compgen -W "get list" -- $cur) );;
|
|
2)
|
|
case $prev in
|
|
get)
|
|
COMPREPLY=( $(compgen -W "$(ghq list --unique)" -- $cur) );;
|
|
list)
|
|
COMPREPLY=( $(compgen -W "$(ghq list)" -- $cur) );;
|
|
esac;;
|
|
*)
|
|
COMPREPLY=( $(compgen -W "$(ls)" -- $cur) );;
|
|
esac
|
|
}
|
|
|
|
complete -F _ghq ghq
|