about summary refs log tree commit diff
path: root/Completion/Debian/Command/_debfoster
blob: 8f7f1b082be3db13aed7506bdd50c12e0a57b428 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#compdef debfoster

_arguments \
'(--verbose)-v[be a loudmouth]' \
'(-v)--verbose[be a loudmouth]' \
'(--version)-V[show version and copyright information]' \
'(-V)--version[show version and copyright information]' \
'(--help)-h[show this message]' \
'(-h)--help[show this message]' \
'(--quiet)-q[silently build keeper file]' \
'(-q)--quiet[silently build keeper file]' \
'(--force)-f[force system to conform to keeper file]' \
'(-f)--force[force system to conform to keeper file]' \
'(--mark-only)-m[do not install or delete packages]' \
'(-m)--mark-only[do not install or delete packages]' \
'(--upgrade)-u[try to upgrade dependencies]' \
'(-u)--upgrade[try to upgrade dependencies]' \
'(--config FILE)-c[specify configuration file]' \
'(-c)--config FILE[specify configuration file]' \
'(--keeperfile FILE)-k[specify keeper file]' \
'(-k)--keeperfile FILE[specify keeper file]' \
'(--no-keeperfile)-n[do not read keeper file]' \
'(-n)--no-keeperfile[do not read keeper file]' \
'(--ignore-default-rules)-i[ignore default rules]' \
'(-i)--ignore-default-rules[ignore default rules]' \
'(--show-keepers)-a[show packages on keeper list]' \
'(-a)--show-keepers[show packages on keeper list]' \
'(--show-orphans)-s[show orphaned packages]' \
'(-s)--show-orphans[show orphaned packages]' \
'(--show-depends)-d[show all depends of PACKAGE]:package:_deb_packages avail'   \
'(-d)--show-depends[show all depends of PACKAGE]:package:_deb_packages avail'   \
'(--show-dependents)-e[show dependents of PACKAGE]:package:_deb_packages avail' \
'(-e)--show-dependents[show dependents of PACKAGE]:package:_deb_packages avail' \
'(--show-providers)-p[show packages providing PACKAGE]:package:_deb_packages avail' \
'(-p)--show-providers[show packages providing PACKAGE]:package:_deb_packages avail' \
'(--show-related)-r[show packages brought in by PACKAGE]:package:_deb_packages avail' \
'(-r)--show-related[show packages brought in by PACKAGE]:package:_deb_packages avail' \
'(--use-tasks)-t[make tasks visible as packages]' \
'(-t)--use-tasks[make tasks visible as packages]' \
'*-'{-option,o}'[override any configuration option]:option string:->option' \
'*:package markings: _alternative "installed:installed packages:_deb_packages -S- installed" "uninstalled:uninstalled packages:_deb_packages uninstalled"' \
&& return 0

ret=1

while [[ -n "$state" ]]; do
      lstate="$state"
      state=''

      case "$lstate" in
      option)
        if compset -P '*='; then
          case "$IPREFIX" in
          *(#i)(install|remove|info)cmd*)
            _wanted values expl 'command string' _command && ret=0
            ;;
	  *(#i)(keeperfile|dpkg(status|available))*)
	    _wanted values expl 'metadata file' _files && ret=0
	    ;;
	  *(#i)maxpriority*)
	    _wanted values expl 'package priority' \
	      compadd required important standard optional extra ANY && ret=0
	    ;;
          *(#i)(use(hold|essential|predepends|recommends|suggests|tasks)|negativekeepers|verbose|force|quiet)*)
            _wanted values expl 'truth value' \
              compadd yes no && ret=0
            ;;
	  *(#i)(no|)keepsections*)
            _wanted values expl 'section' \
	      compadd x11 web utils text tex sound shells science \
	       otherosfs oldlibs news net misc math mail libs \
	       interpreters hamradio graphics games electronics \
	       editors doc devel comm base admin && ret=0
	    ;;
	  *(#i)guessdepends*)
            _wanted values expl 'name extension' \
	      compadd doc dev && ret=0
	    ;;
	  esac
	else
          _wanted values expl 'configure file option' \
              compadd -M 'm:{a-z}={A-Z}' -S '=' - \
                  InstallCmd RemoveCmd InfoCmd KeeperFile DpkgStatus \
                  DpkgAvailable MaxPriority UseHold UseEssential \
                  UsePreDepends UseRecommends UseSuggests UseTasks \
                  KeepSections NokeepSections GuessDepends NegativeKeepers \
		  Verbose Force Quiet && ret=0
        fi
        ;;
      esac
done

return ret