about summary refs log tree commit diff
path: root/Completion/Debian/Command/_apt-move
blob: c7ca590996e811fd3f72ae08ce58c83bffa71f3c (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 apt-move

local curcontext="$curcontext" state line ret=1
typeset -A opt_args

_arguments -C \
  '-c[specify an alternative configuration file]' \
  '-d[override the DIST setting]' \
  '-f[override the MAXDELETE setting]' \
  '-q[be quiet; suppress normal output]' \
  '-t[show what apt-move would do, but do not actually do anything]' \
  '1: :->cmds' \
  '*: :->args' && ret=0

case $state in
  cmds)
    local -a cmds
    cmds=('get:update your master files from local apt' \
          'getlocal:alias of get' \
          'fsck:fix broken repositories' \
          'move:move cache files into mirror tree' \
          'movefile:move files into the repository' \
          'delete:delete obsolete packages' \
          'packages:create new local Packages files' \
          'update:alias for: get move delete packages' \
          'local:alias for: move delete packages' \
          'localupdate:alias for: getlocal move delete packages' \
          'mirror:update your local mirror from remote rsync site' \
          'sync:same as mirror, but only gets packages that you currently have installed on your system' \
          'exclude:prints a list of all packages EXCLUDED from the mirror by the .exclude file' \
          'listbin:prints lists of packages which can serve as the input to mirrorbin(mirror,sync,repo)' \
          'listsrc:same as listbin, but lists source packages' \
          'mirrorbin:same as mirror, but gets the packages specified on stdin' \
          'mirrorsrc:same as mirrorbin, but gets source packages')
      _describe -t commands 'apt-move command' cmds && ret=0
  ;;
  args)
    case $line[1] in
	  get|getlocal)
	    # A directory or nothing
		_files -/ && ret=0
	  ;;
	  movefile)
	    # A .dsc or a .deb
		_files -g "*.d(sc|eb)" && ret=0
	  ;;
	esac
  ;;
esac

return ret