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

PATCH: _git and wrapper aliases



A user has a wrapper script which he is aliasing as "git". The following
change allows him to
alias git=gitwrapper
compdef _git gitwrapper=git

I just woke up, and I have no idea if I've broken anything.

Index: Completion/Unix/Command/_git
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_git,v
retrieving revision 1.60
diff -u -r1.60 _git
--- Completion/Unix/Command/_git	28 Feb 2008 17:20:44 -0000	1.60
+++ Completion/Unix/Command/_git	9 Mar 2008 12:10:14 -0000
@@ -4138,7 +4138,7 @@
     unset tmpwords
   fi
 
-  if [[ $words[1] == git ]]; then
+  if [[ $service == git ]]; then
     local state line
     declare -A opt_args
     _arguments -C \
@@ -4155,12 +4155,12 @@
         __git_aliases_and_commands
         ;;
       (options)
-        curcontext="${curcontext%:*:*}:git-$words[1]:"
-        _call_function ret _git-$words[1]
+        curcontext="${curcontext%:*:*}:git-$service:"
+        _call_function ret _git-$service
         ;;
     esac
   else
-    _call_function ret _$words[1]
+    _call_function ret _$service
   fi
 }
 



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