[darcs-users] darcs patch: New updated Zsh completion script (c.f. issue 1301)

Eric Kow kowey at darcs.net
Fri Mar 13 09:38:44 UTC 2009


I'm applying this one without much review (thanks!)

On Thu, Mar 12, 2009 at 13:42:23 -0700, Nicolas Pouillard wrote:
> Thu Mar 12 21:35:09 CET 2009  Nicolas Pouillard <nicolas.pouillard at gmail.com>
>   * New updated Zsh completion script (c.f. issue 1301)

Any zsh users want to have a look?  Can we get rid of the old script?

New updated Zsh completion script (c.f. issue 1301)
---------------------------------------------------
> Nicolas Pouillard <nicolas.pouillard at gmail.com>**20090312203509
>  Ignore-this: f2c93c75b8d128d31db264eb77cdddba
> ] addfile ./tools/_darcs.zsh
> hunk ./tools/_darcs.zsh 1
> +#compdef darcs
> +
> +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 at possible options
> +    *)
> +      _wanted args expl 'arg for darcs command' \
> +        compadd -- $( darcs ${words[2]} --list-option )
> +      ;;
> +  esac
> +fi
> 

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20090313/1d2568ca/attachment.pgp>


More information about the darcs-users mailing list