about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorOliver Kiddle <okiddle@yahoo.co.uk>2018-03-23 09:57:39 +0100
committerOliver Kiddle <okiddle@yahoo.co.uk>2018-03-23 09:57:39 +0100
commitf1a52c23fa6c3c27c32b6a04d731b7d2c2f3c4b4 (patch)
tree18762a46ddd9a54eabe1679eab62db22ecd1c634 /Completion
parentfc37d15e3e102ecba8fcdf38f389843fcab11065 (diff)
downloadzsh-f1a52c23fa6c3c27c32b6a04d731b7d2c2f3c4b4.tar.gz
zsh-f1a52c23fa6c3c27c32b6a04d731b7d2c2f3c4b4.tar.xz
zsh-f1a52c23fa6c3c27c32b6a04d731b7d2c2f3c4b4.zip
42497 (tweaked c.f. 42498): make completion after apt install work on local .deb files
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Debian/Command/_apt27
1 files changed, 14 insertions, 13 deletions
diff --git a/Completion/Debian/Command/_apt b/Completion/Debian/Command/_apt
index aabe03d3c..645b02279 100644
--- a/Completion/Debian/Command/_apt
+++ b/Completion/Debian/Command/_apt
@@ -408,12 +408,13 @@ _apt-cmd () {
     /$'policy\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
     /$'update\0'/ \| \
     \( \
-    /$'install\0'\|$'download\0'\|$'source\0'\|$'build-dep\0'/ \
-      /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \
-       \( \
-       /$'[^\0/]#/'/ /$'[^\0/]#\0'/ ':release name::_apt_releases' \| \
-       /$'[^\0=]#='/ /$'[^\0=]#\0'/ ':package version::_apt_versions_of_binary_package' \
-       \)  \
+      /$'(install|download|source|build-dep)\0'/ -'subcmd=${match%?}' \
+      /$'[^\0]#\0'/ ':packages::_deb_packages -qr "\n\t\- /=" "$expl_packages[@]" avail' \# \
+      \( \
+	// '%(.|)/%' -'[[ $subcmd = install ]]' /'[]'/ ':files:package file:_files -g "*.deb(-.)"' \| \
+	/$'[^\0/=]#\/'/ /'[]'/ ':apt-releases:release name:_apt_releases' \| \
+	/$'[^\0/=]#='/ /'[]'/ ':apt-package-versions:package version:_apt_versions_of_binary_package' \| \
+      \) \
     \) \| \
     /$'remove\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
     /$'purge\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
@@ -427,7 +428,7 @@ _apt-cmd () {
     /"[]"/	':argument-1::compadd "$expl_action[@]" list search showsrc show depends rdepends policy update install download source build-dep remove upgrade full-upgrade dist-upgrade edit-sources autoclean changelog autoremove purge'
 
   _apt-cmd () {
-    local expl_action expl_packages
+    local expl_action expl_packages subcmd
     _description actions expl_action 'action'
     _description packages expl_packages 'package'
 
@@ -475,11 +476,11 @@ _apt-get () {
     /$'upgrade\0'/ \| \
     \( \
     /$'install\0'\|$'download\0'\|$'source\0'\|$'build-dep\0'/ \
-      /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \
-       \( \
-       /$'[^\0/]#/'/ /$'[^\0/]#\0'/ ':release name::_apt_releases' \| \
-       /$'[^\0=]#='/ /$'[^\0=]#\0'/ ':package version::_apt_versions_of_binary_package' \
-       \)  \
+      /$'[^\0]#\0'/ ':packages::_deb_packages -qr "\n\t\- /=" "$expl_packages[@]" avail' \# \
+      \( \
+	/$'[^\0/=]#/'/ /'[]'/ ':apt-releases:release name:_apt_releases' \| \
+	/$'[^\0/=]#='/ /'[]'/ ':apt-package-versions:package version:_apt_versions_of_binary_package' \
+      \) \
     \) \| \
     /$'remove\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
     /$'purge\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
@@ -662,7 +663,7 @@ _apt_versions_of_binary_package() {
     done
   done
 
-  _describe -t apt-package-versions "package versions" kv "$@"
+  _describe -t apt-package-versions 'package version' kv "$@"
 }
 
 _apt_caching_policy () {