zshrc: do not overrule native completions to _gnu_generic
authorFrank Terbeck <ft@bewatermyfriend.org>
Sat, 4 Apr 2009 09:45:47 +0000 (11:45 +0200)
committerFrank Terbeck <ft@bewatermyfriend.org>
Sat, 4 Apr 2009 09:45:47 +0000 (11:45 +0200)
Only compdef commands to _gnu_generic if no native completion exists.
This should fix problems with _gnu_generic and output from cp of
coreutils version 7.1.

debian/changelog
etc/zsh/zshrc

index b2c6d3e..49a97ad 100644 (file)
@@ -2,10 +2,12 @@ grml-etc-core (0.3.66) unstable; urgency=low
 
   * vimrc: only set screen title if the caller explicitly asks for it.
   * zshrc: ask for setting screen title in vim via a wrapper function.
+  * zshrc: only compdef commands to _gnu_generic if no native completion
+    exists.
   * zshrc: add commit-to-history widget, that allows users to add
     command lines to zsh's history without executing [Closes: issue407]
 
- -- Frank Terbeck <ft@grml.org>  Fri, 03 Apr 2009 22:49:53 +0200
+ -- Frank Terbeck <ft@grml.org>  Sat, 04 Apr 2009 11:35:06 +0200
 
 grml-etc-core (0.3.65) unstable; urgency=low
 
index e76be64..e1e8a13 100644 (file)
@@ -2471,7 +2471,9 @@ grmlcomp() {
 
     # use generic completion system for programs not yet defined; (_gnu_generic works
     # with commands that provide a --help option with "standard" gnu-like output.)
-    compdef _gnu_generic tail head feh cp mv df stow uname ipacsum fetchipac
+    for compcom in tail head feh cp mv df stow uname ipacsum fetchipac; do
+        [[ -z ${_comps[$compcom]} ]] && compdef _gnu_generic ${compcom}
+    done; unset compcom
 
     # see upgrade function in this file
     compdef _hosts upgrade