Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: _git: Offer git-foo commands from $PATH
- X-seq: zsh-workers 29514
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: _git: Offer git-foo commands from $PATH
- Date: Tue, 28 Jun 2011 00:13:21 +0200
- Cc: Nikolai Weibull <now@xxxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
This helps supporting third-party add-ons. This could be made smarter,
like filtering out git-foo commands where `foo' is already in another
sub-command group. Like `git cvsserver' which is already in "interaction
commands".
This could also be made optional via a boolean style... I don't know.
What about others? Nikolai?
---
Completion/Unix/Command/_git | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 2b8b8d6..12790a7 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -4591,6 +4591,9 @@ _git_commands () {
patch-id:'compute unique ID for a patch'
stripspace:'filter out empty lines')
+ local -a git_commands_from_path
+ git_commands_from_path=( ${${commands[(I)git-*]}#git-} )
+
integer ret=1
# TODO: Is this the correct way of doing it?
# TODO: Should we be chaining them together with || instead?
@@ -4603,6 +4606,7 @@ _git_commands () {
_describe -t plumbing-sync-commands 'plumbing sync command' plumbing_sync_commands && ret=0
_describe -t plumbing-sync-helper-commands 'plumbing sync helper command' plumbing_sync_helper_commands && ret=0
_describe -t plumbing-internal-helper-commands 'plumbing internal helper command' plumbing_internal_helper_commands && ret=0
+ _describe -t sub-commands-from-path 'sub commands from path' git_commands_from_path && ret=0
return ret
}
--
1.7.5
Messages sorted by:
Reverse Date,
Date,
Thread,
Author