mirror of
https://github.com/x-motemen/ghq.git
synced 2026-09-10 07:26:27 -04:00
Merge pull request #390 from Okabe-Junya/rm-completion
feat(misc): support "ghq rm" completion
This commit is contained in:
commit
9bb6aaa9c8
|
|
@ -4,13 +4,15 @@ function _ghq () {
|
|||
|
||||
case $cword in
|
||||
1)
|
||||
COMPREPLY=( $(compgen -W "get list" -- $cur) );;
|
||||
COMPREPLY=( $(compgen -W "get list rm" -- $cur) );;
|
||||
2)
|
||||
case $prev in
|
||||
get)
|
||||
COMPREPLY=( $(compgen -W "$(ghq list --unique)" -- $cur) );;
|
||||
list)
|
||||
COMPREPLY=( $(compgen -W "$(ghq list)" -- $cur) );;
|
||||
rm)
|
||||
COMPREPLY=( $(compgen -W "$(ghq list)" -- $cur) );;
|
||||
esac;;
|
||||
*)
|
||||
COMPREPLY=( $(compgen -W "$(ls)" -- $cur) );;
|
||||
|
|
|
|||
|
|
@ -51,6 +51,12 @@ function _ghq () {
|
|||
'(-)*:: :->null_state' \
|
||||
&& ret=0
|
||||
;;
|
||||
(rm)
|
||||
_arguments -C \
|
||||
'--dry-run[Do not remove actually]' \
|
||||
'(-)*:: :->null_state' \
|
||||
&& ret=0
|
||||
;;
|
||||
(help|h)
|
||||
__ghq_commands && ret=0
|
||||
;;
|
||||
|
|
|
|||
Loading…
Reference in a new issue