Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: init.d completion



On Mar 11,  2:34pm, Andrej Borsenkow wrote:
} Subject: init.d completion
}
} Most (many) of scripts in our /etc/init.d are not executable, so I have to
} use 'sh foo' instead of plain 'foo'. Not sure how to handle it; putting
} special case in sh completion?

_sh is pretty braindead at the moment.  Unless you're using "sh -c ..."
it only uses _default completion.  Here's a fairly simple potential fix:


Index: Completion/User/_sh
===================================================================
diff -c -r1.1.1.1 _sh
--- Completion/User/_sh	1999/07/20 08:11:00	1.1.1.1
+++ Completion/User/_sh	2001/03/11 17:28:10
@@ -4,5 +4,6 @@
   compset -q
   _normal
 else
-  _default
+  compset -n ${words[(b:2:i)[^-]*]}
+  _normal || _default
 fi


-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author