File: _ditz.zsh

package info (click to toggle)
ditz 0.5-1
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 356 kB
  • ctags: 489
  • sloc: ruby: 3,664; sh: 15; makefile: 12
file content (29 lines) | stat: -rw-r--r-- 826 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#compdef ditz

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