[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-385-gccb8c91
Ville Skyttä
ville.skytta at iki.fi
Sat Jun 18 20:29:08 UTC 2011
The following commit has been merged in the master branch:
commit 50d44ca3a4d712845d6e40c624f23ac9cd851c18
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Sat Jun 18 23:01:00 2011 +0300
_services: Avoid bogus completions when init or xinetd dirs exist but are empty.
diff --git a/bash_completion b/bash_completion
index 4b7766f..98c2fd7 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1038,12 +1038,17 @@ _services()
local sysvdir famdir
[ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d
famdir=/etc/xinetd.d
+
+ local restore_nullglob=$(shopt -p nullglob); shopt -s nullglob
+
COMPREPLY=( $( printf '%s\n' $sysvdir/!($_backup_glob|functions) ) )
if [ -d $famdir ]; then
COMPREPLY+=( $( printf '%s\n' $famdir/!($_backup_glob) ) )
fi
+ $restore_nullglob
+
COMPREPLY=( $( compgen -W '${COMPREPLY[@]#@($sysvdir|$famdir)/}' -- "$cur" ) )
}
--
bash-completion
More information about the Bash-completion-commits
mailing list