1
# bash completion for yp-tools
9
_get_comp_words_by_ref cur
12
[[ $cmd == ypcat && $COMP_CWORD -gt 1 ]] && return 0
13
[[ $cmd == ypmatch && $COMP_CWORD -gt 2 ]] && return 0
15
if [[ $cmd == ypmatch && $COMP_CWORD -eq 1 && \
16
${#COMP_WORDS[@]} -eq 3 ]]; then
18
COMPREPLY=( $( compgen -W '$( ypcat $map | \
19
cut -d':' -f 1 )' -- "$cur") )
21
[[ $cmd == ypmatch && $COMP_CWORD -ne 2 ]] && return 0
22
COMPREPLY=( $( compgen -W \
23
'$( printf "%s\n" $(ypcat -x | cut -d"\"" -f 2) )' -- "$cur"))
28
complete -F _ypmatch ypmatch ypcat
33
# sh-indent-comment: t
34
# indent-tabs-mode: nil
36
# ex: ts=4 sw=4 et filetype=sh