[Bash-completion-commits] ./current r1240: Improved getent completion (myself, Guillaume Rousse).

Ville Skyttä ville.skytta at iki.fi
Sun Jan 11 23:08:01 UTC 2009


------------------------------------------------------------
revno: 1240
committer: Ville Skyttä <ville.skytta at iki.fi>
branch nick: current
timestamp: Mon 2009-01-12 01:08:01 +0200
message:
  Improved getent completion (myself, Guillaume Rousse).
modified:
  bash_completion
  debian/changelog
-------------- next part --------------
=== modified file 'bash_completion'
--- a/bash_completion	2009-01-11 22:35:56 +0000
+++ b/bash_completion	2009-01-11 23:08:01 +0000
@@ -8751,19 +8751,24 @@
 			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 | \
+				sed -ne 's|^\('$cur'[^[:space:]]*\).*|\1|p' ) )
 			return 0
 			;;
-		networks)
-			COMPREPLY=( $( getent networks | awk '{print $1}' | grep "^$cur" ) )
+		aliases|shadow)
+			COMPREPLY=( $( getent $prev | \
+				sed -ne 's|^\('$cur'[^:]*\).*|\1|p' ) )
 			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

=== modified file 'debian/changelog'
--- a/debian/changelog	2009-01-11 22:35:56 +0000
+++ b/debian/changelog	2009-01-11 23:08:01 +0000
@@ -63,6 +63,7 @@
   * Added support for p (POSIX) and x (x.org) man sections (Ville Skyttä).
   * Improved filename based man page completion (Ville Skyttä).
   * Added minimal sqlite3 completion (Ville Skyttä).
+  * Improved getent completion (Ville Skyttä, Guillaume Rousse).
   * Merge from Gentoo:
     - fix 'find' completion so that it properly completes on -?(i)whilename.
       Patch by Ciaran McCreesh.



More information about the Bash-completion-commits mailing list