CVS: moonbase/shells/bash/profile.d bash-completion.rc,1.6,1.7
csm at lunar-linux.org
csm at lunar-linux.org
Thu Sep 25 00:48:37 GMT 2003
Update of /var/cvs/lunar/moonbase/shells/bash/profile.d
In directory dbguin.lunar-linux.org:/tmp/cvs-serv28812
Modified Files:
bash-completion.rc
Log Message:
adding autocompletion for postfix configuration.
some may find it useful
Index: bash-completion.rc
===================================================================
RCS file: /var/cvs/lunar/moonbase/shells/bash/profile.d/bash-completion.rc,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- bash-completion.rc 12 Apr 2003 19:53:51 -0000 1.6
+++ bash-completion.rc 25 Sep 2003 00:48:35 -0000 1.7
@@ -53,3 +53,18 @@
complete -F _modules_installed lrm lrm2
+function _postconf_ ()
+{
+ local cmd=${COMP_WORDS[COMP_CWORD]}
+ local idx=0
+ local clen=${#cmd}
+ for pval in $(/usr/sbin/postconf | cut -d" " -f1); do
+ if [ "$cmd" == "${pval:0:$clen}" ]; then
+ COMPREPLY[$idx]=$pval
+ idx=$[$idx+1]
+ fi
+ done
+}
+
+complete -F _postconf_ postconf
+
More information about the Lunar-commits
mailing list