* Upgrading the Darcs completion support of Zsh
@ 2009-06-03 8:56 Nicolas Pouillard
2009-06-04 13:02 ` Peter Stephenson
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Pouillard @ 2009-06-03 8:56 UTC (permalink / raw)
To: Zsh Workers
[-- Attachment #1: Type: text/plain, Size: 216 bytes --]
Hello,
In the Darcs team, we've upgraded our Zsh completion script.
The new one is a lot simpler and will scale better to darcs
upgrade.
I leave it as attachment.
--
Nicolas Pouillard
http://nicolaspouillard.fr
[-- Attachment #2: _darcs.zsh --]
[-- Type: application/octet-stream, Size: 1199 bytes --]
#compdef darcs
## Darcs completion snippet for zsh.
##
## Copyright (C) 2009 Nicolas Pouillard
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
if (($CURRENT == 2)); then
# We're completing the first word after "darcs" -- the command.
_wanted command expl 'darcs command' \
compadd -- $( darcs --commands )
else
case "${words[$CURRENT]}"; in
# If it looks like an URL...
ht*|ft*)
_arguments '*:URL:_urls'
;;
# If it looks like an explicit path...
/*|./*|\~*|../*)
_arguments '*:file:_files'
;;
# Otherwise, let's ask darcs for all possible options
*)
_wanted args expl 'arg for darcs command' \
compadd -- $( darcs ${words[2]} --list-option )
;;
esac
fi
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Upgrading the Darcs completion support of Zsh
2009-06-03 8:56 Upgrading the Darcs completion support of Zsh Nicolas Pouillard
@ 2009-06-04 13:02 ` Peter Stephenson
0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2009-06-04 13:02 UTC (permalink / raw)
To: Zsh Workers
On Wed, 03 Jun 2009 10:56:08 +0200
Nicolas Pouillard <nicolas.pouillard@gmail.com> wrote:
> Hello,
>
> In the Darcs team, we've upgraded our Zsh completion script.
>
> The new one is a lot simpler and will scale better to darcs
> upgrade.
I've been waiting to see if anyone commented on this, seeing as it's very
much shorter than the previous one, but if no one is interested I'll simply
commit it.
--
Peter Stephenson <pws@csr.com> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-06-04 13:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-03 8:56 Upgrading the Darcs completion support of Zsh Nicolas Pouillard
2009-06-04 13:02 ` Peter Stephenson
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).