From 3876601c794b57342d14152bef1884f2a4213621 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 30 Mar 2004 16:38:04 +0000 Subject: 19708: change getent() to handle two arguments --- Completion/compaudit | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Completion') diff --git a/Completion/compaudit b/Completion/compaudit index c4dbb6e11..25ba21c94 100644 --- a/Completion/compaudit +++ b/Completion/compaudit @@ -15,7 +15,13 @@ compaudit() { # Define and then call emulate -L zsh setopt extendedglob -[[ -x /usr/bin/getent ]] || getent() { cat /etc/$1 } +[[ -x /usr/bin/getent ]] || getent() { + if [[ $2 = <-> ]]; then + grep ":$2:[^:]*$" /etc/$1 + else + grep "^$2:" /etc/$1 + fi +} # The positional parameters are the directories to check, else fpath. if (( $# )); then -- cgit 1.4.1