/bash_completion_lib/complete/filesnarf
http://github.com/brinkman83/bashrc · #! · 29 lines · 20 code · 9 blank · 0 comment · 0 complexity · 44dc0441308372a0f3c48e5f5f6dc35b MD5 · raw file
- # filesnarf(8), mailsnarf(8) and msgsnarf (8) completion
- comp_include _get_cword
- _snarf()
- {
- local cur
- COMPREPLY=()
- cur=`_get_cword`
- prev=${COMP_WORDS[COMP_CWORD-1]}
- case "$prev" in
- -i)
- _interfaces
- return 0
- ;;
- esac
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '-i -v' -- $cur ) )
- fi
- } # _snarf()
- comp_install -F _snarf # Make completion persistent for subsequent invocations
- _snarf # Generate completions for first invocation