mirror of
https://github.com/x-motemen/ghq.git
synced 2026-09-10 07:26:27 -04:00
Add bash-completion
This commit is contained in:
parent
bb059e45e7
commit
f99b497b6f
20
misc/bash/_ghq
Normal file
20
misc/bash/_ghq
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
function _ghq () {
|
||||
local cur prev words cword
|
||||
_init_completion || return
|
||||
|
||||
case $cword in
|
||||
1)
|
||||
COMPREPLY=( $(compgen -W "get list look" -- $cur) );;
|
||||
2)
|
||||
case $prev in
|
||||
get)
|
||||
COMPREPLY=( $(compgen -W "$(ghq list --unique)" -- $cur) );;
|
||||
list|look)
|
||||
COMPREPLY=( $(compgen -W "$(ghq list)" -- $cur) );;
|
||||
esac;;
|
||||
*)
|
||||
COMPREPLY=( $(compgen -W "$(ls)" -- $cur) );;
|
||||
esac
|
||||
}
|
||||
|
||||
complete -F _ghq ghq
|
||||
Loading…
Reference in a new issue