bash-completion/bash-completion-20080705-getent.patch

28 lines
951 B
Diff
Raw Normal View History

--- bash_completion~ 2008-07-05 16:55:03.000000000 +0300
+++ bash_completion 2009-01-06 19:00:26.000000000 +0200
@@ -8742,19 +8742,19 @@
COMPREPLY=( $( compgen -A hostname $cur ) )
return 0
;;
- protocols)
- COMPREPLY=( $( getent protocols | awk '{print $1}' | grep "^$cur" ) )
+ protocols|networks|ahosts|ahostsv4|ahostsv6|rpc)
+ COMPREPLY=( $( getent $prev | awk '{print $1}' | grep "^$cur" ) )
return 0
;;
- networks)
- COMPREPLY=( $( getent networks | awk '{print $1}' | grep "^$cur" ) )
+ aliases|shadow)
+ COMPREPLY=( $( getent $prev | cut -d : -f 1 | grep "^$cur" ) )
return 0
;;
esac
if [ $COMP_CWORD -eq 1 ]; then
- COMPREPLY=( $( compgen -W 'passwd group hosts services protocols networks' -- $cur ) )
+ COMPREPLY=( $( compgen -W 'passwd group hosts services protocols networks ahosts ahostsv4 ahostsv6 aliases ethers netgroup rpc shadow' -- $cur ) )
fi
} &&
complete -F _getent getent