From c3e0113d1ce0895477d409a05ff19819ce5aa9bc Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Wed, 30 Jan 2002 03:38:29 +0000 Subject: 16514: initscript completion fixes --- Completion/Unix/Command/_init_d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command/_init_d') diff --git a/Completion/Unix/Command/_init_d b/Completion/Unix/Command/_init_d index 280b0a9af..b8bd0c61f 100644 --- a/Completion/Unix/Command/_init_d +++ b/Completion/Unix/Command/_init_d @@ -9,8 +9,8 @@ local magic cmds what what='(st(art|op|atus)|(force-|)re(start|load)|debug_(up|down)|dump(|_stats)|add|delete|clean|list)' -read -u0k 2 magic < $words[1] && [[ $magic = '#!' ]] && - cmds=( ${${(j:|:s:|:)${(M)${(f)"$(< $words[1])"}:#[[:blank:]]#(\'|)${~what}(|${~what})#(\'|)\)}}//[^a-z_]} ) +[[ -f $words[1] ]] && read -u0k 2 magic < $words[1] && [[ $magic = '#!' ]] && + cmds=( ${${(j:|:s:|:)${(M)${(f)"$(< $words[1])"}:#[[:blank:]]#\'#${~what}(\|${~what})#\'#\)*}}//[^a-z_-]} ) # This would be the pattern to use every line of the form foo). # Some people say this might match too many lines... -- cgit 1.4.1