about summary refs log tree commit diff
path: root/Completion/Debian
diff options
context:
space:
mode:
authorPaul Ackersviller <packersv@users.sourceforge.net>2007-11-11 17:49:06 +0000
committerPaul Ackersviller <packersv@users.sourceforge.net>2007-11-11 17:49:06 +0000
commit90951bd9cdc4360e519255a6b914f5d38f95b547 (patch)
treea20bede30f4bbb08a0a87d4d0ffc69c7c24a95ed /Completion/Debian
parentfe1416410c68c77c500c9f3fe4ba997a614db869 (diff)
downloadzsh-90951bd9cdc4360e519255a6b914f5d38f95b547.tar.gz
zsh-90951bd9cdc4360e519255a6b914f5d38f95b547.tar.xz
zsh-90951bd9cdc4360e519255a6b914f5d38f95b547.zip
23059: Merge new completion onto 4.2 branch.
Diffstat (limited to 'Completion/Debian')
-rw-r--r--Completion/Debian/Command/_apt-file55
1 files changed, 55 insertions, 0 deletions
diff --git a/Completion/Debian/Command/_apt-file b/Completion/Debian/Command/_apt-file
new file mode 100644
index 000000000..fcc0482e9
--- /dev/null
+++ b/Completion/Debian/Command/_apt-file
@@ -0,0 +1,55 @@
+#compdef apt-file
+
+_apt-file() {
+  local -a arguments
+  local state line cmds 
+  arguments=(
+    '(--cache -c)'{--cache,-c}'[cache directory]:directory:_directories'
+    '(-v --verbose)'{-v,--verbose}'[verbose]'
+     '(--cdrom-mount -d)'{--cdrom-mount,-d}'[cdrom mount point]:directory:_directories'
+     '(--ignore-case -i)'{--ignore-case,-i}'[ignore case]'
+     '(--regexp -r)'{--regexp,-r}'[regular expression]'
+     '(-V --version)'{-V,--version}'[version]'
+     '(-a --architecture)'{-a,--architecture}'[architecture]:architecture:(alpha arm hppa hurd-i386 i386 ia64 m68k mips mipsel powerpc s390 sparc)'
+    '(-s --sources-list)'{-s,--sources-list}'[source.list file]:file:_files'
+    '(-l --package-only)'{-l,--package-only}'[only display package name]'
+    '(-F --fixed-string)'{-F,--fixed-string}'[do not expand search pattern]'
+    '(-y --dummy)'{-y,--dummy}'[run in dummy mode]'
+    '(-h --help)'{-h,--help}'[display help screen]'
+    '1: :->cmds'
+    '*: :->args'
+  )
+    _arguments -S $arguments
+
+    case $state in
+      cmds)
+        cmds=(
+            'update:Resynchronize package contents'
+            'search:Search in which package file is included'
+            'list:List contents of a package'
+            'show:Alias for list'
+            'purge:remove all Contents-<ARCH>.gz files in cache directory'
+        )
+        _describe -t commands 'apt-list command' cmds && ret=0
+      ;;
+      args)
+        case $line[1] in
+            search)
+                _message "pattern"
+            ;;
+            list|show)
+               _deb_packages avail 
+            ;;
+            update|purge)
+                # do nothing
+            ;;
+            *)
+                _message "command $line[1] not available"
+            ;;
+        esac
+      ;;
+    esac
+
+}
+
+_apt-file "$@"