Skip to content

Commit

Permalink
Merge pull request #390 from Okabe-Junya/rm-completion
Browse files Browse the repository at this point in the history
feat(misc): support "ghq rm" completion
  • Loading branch information
Songmu authored Jul 12, 2024
2 parents 1acf651 + 07297a7 commit 9bb6aaa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion misc/bash/_ghq
Original file line number Diff line number Diff line change
Expand Up @@ -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) );;
Expand Down
6 changes: 6 additions & 0 deletions misc/zsh/_ghq
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
Expand Down

0 comments on commit 9bb6aaa

Please sign in to comment.