about summary refs log tree commit diff
path: root/Completion/Debian/Command/_vim-addons
blob: 0ad39955d3a35266d4034ed88c2dc643d7488786 (plain) (blame)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#compdef vim-addons

local context state line expl ret=1
typeset -A opt_args

_arguments \
  '(-q --query)'{-q,--query}'[be quiet and make the output more parseable]' \
  '(-r --registry-dir)'{-r,--registry-dir}'[set the registry directory]' \
  '(-s --source-dir)'{-s,--source-dir}'[set addon source directory]' \
  '(-t --target-dir -w --system-wide)'{-t,--target-dir}'[set addon target directory]' \
  '(-v --verbose -z --silent)'{-v,--verbose}'[increase verbosity]' \
  '(y --system-dir)'{-y,--system-dir}'[set system-wide target directory]' \
  '(-)'{-h,--help}'[show help information]' \
  '(-w --system-wide -t --target-dir)'{-w,--system-wide}'[use system-wide target directory]' \
  '(-z --silent -v --verbose)'{-z,--silent}'[supress most output]' \
  '1:commands:((
    install\:install\ specified\ addons
    remove\:remove\ specified\ addons
    list\:list\ available\ addons\ in\ registry
    status\:list\ status\ of\ addons
    disable\:disable\ specified\ addons
    enable\:undo\ effects\ of\ previous\ disable
    files\:list\ files\ composing\ the\ specified\ addon
    show\:display\ detailed\ information\ on\ specified\ addon
  ))' \
  '*: :->args' && ret=0

case $state in
  args)
    case $line[1] in
      install)
        _wanted -C $context addons expl 'addon' compadd - \
	    ${${(M)${(f)"$(_call_program addons vim-addons -q)"}:#*removed}%$'\t'*} && ret=0
      ;;
      enable)
        _wanted -C $context addons expl 'addon' compadd - \
	    ${${(M)${(f)"$(_call_program addons vim-addons -q)"}:#*disabled}%$'\t'*} && ret=0
      ;;
      remove)
        _wanted -C $context addons expl 'addon' compadd - \
	    ${${(M)${(f)"$(_call_program addons vim-addons -q)"}:#*(disabled|installed)}%$'\t'*} && ret=0
      ;;
      *)
        _wanted -C $context addons expl 'addon' compadd - \
	    $(_call_program addons vim-addons list) && ret=0
      ;;
    esac
  ;;
esac

return ret