zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _mercurial
@ 2007-03-08  4:28 Clint Adams
  2007-03-08 21:00 ` Danek Duvall
  0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 2007-03-08  4:28 UTC (permalink / raw)
  To: zsh-workers

Here's wondering if someone will reply with a more comprehensive
completion function.

Index: Completion/Unix/Command/_mercurial
===================================================================
RCS file: Completion/Unix/Command/_mercurial
diff -N Completion/Unix/Command/_mercurial
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Completion/Unix/Command/_mercurial	8 Mar 2007 04:26:19 -0000
@@ -0,0 +1,27 @@
+#compdef hg
+
+local context state line
+typeset -A opt_args
+
+if (( ! $+_mercurial_cmds )); then
+  local _mercurial_cmds
+  _mercurial_cmds=( $($service debugcomplete) )
+fi
+if (( ! $+_mercurial_options )); then
+  local _mercurial_options
+  _mercurial_options=( $($service debugcomplete --options) )
+fi
+
+_arguments \
+  "$_mercurial_options[@]" \
+  '*:command:->subcmds' && return 0
+
+case "$state" in
+  (subcmds)
+    if (( CURRENT == 2 )); then
+      compadd -- "$_mercurial_cmds[@]"
+    else
+      _files
+    fi
+  ;;
+esac


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: _mercurial
  2007-03-08  4:28 PATCH: _mercurial Clint Adams
@ 2007-03-08 21:00 ` Danek Duvall
  0 siblings, 0 replies; 2+ messages in thread
From: Danek Duvall @ 2007-03-08 21:00 UTC (permalink / raw)
  To: zsh-workers

On Wed, Mar 07, 2007 at 11:28:49PM -0500, Clint Adams wrote:

> Here's wondering if someone will reply with a more comprehensive
> completion function.

There's one in the mercurial distribution -- contrib/zsh_completion.  I
don't know how well it works, though.

Danek


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-08 21:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-08  4:28 PATCH: _mercurial Clint Adams
2007-03-08 21:00 ` Danek Duvall

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).