Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: _git and wrapper aliases
- X-seq: zsh-workers 24701
- From: Clint Adams <clint@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: PATCH: _git and wrapper aliases
- Date: Sun, 9 Mar 2008 08:12:48 -0400
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
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