Skip to content

Commit

Permalink
Add bash-completion
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn committed Dec 24, 2019
1 parent bb059e4 commit f99b497
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions misc/bash/_ghq
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.

0 comments on commit f99b497

Please sign in to comment.