updated on Tue Jan 10 12:02:00 UTC 2012
[aur-mirror.git] / bashbookmarks / bash_bookmarks_completion
blobc6818a784f3041e524589dc3304dacc75e37b4a1
1 if [ ! -n "$BASH_BOOKMARKS" ];then export BASH_BOOKMARKS=$HOME/.bash_bookmarks;fi
3 _gat() 
5     local cur prev opts
6     COMPREPLY=()
7     cur="${COMP_WORDS[COMP_CWORD]}"
8     prev="${COMP_WORDS[COMP_CWORD-1]}"
9     marks=""
10     for i in `find $BASH_BOOKMARKS -maxdepth 1 -type f`;do\
11       marks=`basename $i`" "$marks;\
12     done
13     opts=$marks
14     if [[ ${prev} == "gat" ]]; then
15         COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
16         return 0
17       fi
19 complete -F _gat gat