zsh-workers
 help / color / mirror / code / Atom feed
From: Nicolas Pouillard <nicolas.pouillard@gmail.com>
To: Zsh Workers <zsh-workers@sunsite.dk>
Subject: Upgrading the Darcs completion support of Zsh
Date: Wed, 03 Jun 2009 10:56:08 +0200	[thread overview]
Message-ID: <1244016080-sup-5263@ausone.inria.fr> (raw)

[-- 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

             reply	other threads:[~2009-06-03  9:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-03  8:56 Nicolas Pouillard [this message]
2009-06-04 13:02 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1244016080-sup-5263@ausone.inria.fr \
    --to=nicolas.pouillard@gmail.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).