Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 31 lines (26 sloc) 609 Bytes
#!/bin/bash
_entree()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="watch list show help edit"
case "${prev}" in
watch)
local watchers=$(grep '\[' ~/.entreerc | tr -d [])
COMPREPLY=($(compgen -W "${watchers}" -- ${cur}))
return 0
;;
show)
local watchers=$(grep '\[' ~/.entreerc | tr -d [])
COMPREPLY=($(compgen -W "${watchers}" -- ${cur}))
return 0
;;
*)
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
}
complete -F _entree entree