diff options
| author | Julien Nicoulaud <julien.nicoulaud@gmail.com> | 2011-09-25 19:19:06 +0200 |
|---|---|---|
| committer | Julien Nicoulaud <julien.nicoulaud@gmail.com> | 2011-09-25 19:19:06 +0200 |
| commit | 1ab8d9f003cb9211f58f97096e66a457038fffbf (patch) | |
| tree | d38324240c86b1b183315be8819604e0213e95e6 | |
| parent | #19 leiningen: fix header (diff) | |
| download | zsh-completions-1ab8d9f003cb9211f58f97096e66a457038fffbf.tar zsh-completions-1ab8d9f003cb9211f58f97096e66a457038fffbf.tar.gz zsh-completions-1ab8d9f003cb9211f58f97096e66a457038fffbf.tar.bz2 zsh-completions-1ab8d9f003cb9211f58f97096e66a457038fffbf.tar.lz zsh-completions-1ab8d9f003cb9211f58f97096e66a457038fffbf.tar.xz zsh-completions-1ab8d9f003cb9211f58f97096e66a457038fffbf.tar.zst zsh-completions-1ab8d9f003cb9211f58f97096e66a457038fffbf.zip | |
#18 Ditz: add @technolize's _ditz
| -rw-r--r-- | _ditz | 48 |
1 files changed, 48 insertions, 0 deletions
@@ -0,0 +1,48 @@ +#compdef ditz +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for Ditz (http://ditz.rubyforge.org). +# +# Source: https://github.com/technolize/zsh-completion-funcs +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * technolize (https://github.com/technolize) +# +# ------------------------------------------------------------------------------ +# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- +# vim: ft=zsh sw=2 ts=2 et +# ------------------------------------------------------------------------------ + + +ME=ditz +COMMANDS=--commands +OPTIONS='<options>' + +if (($CURRENT == 2)); then + # We're completing the first word after the tool: the command. + _wanted command expl "$ME command" \ + compadd -- $( "$ME" "$COMMANDS" ) +else + # Find the options/files/URL/etc. for the current command by using the tool itself. + case "${words[$CURRENT]}"; in + -*) + _wanted args expl "Arguments for $ME ${words[2]}" \ + compadd -- $( "$ME" "${words[2]}" "$OPTIONS" ; _files ) + ;; + ht*|ft*) + _arguments '*:URL:_urls' + ;; + /*|./*|\~*|../*) + _arguments '*:file:_files' + ;; + *) + _wanted args expl "Arguments for $ME ${words[2]}" \ + compadd -- $( "$ME" "${words[2]}" "$OPTIONS" ) + ;; + esac +fi |
