about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Sommer <joerg@jo-so.de>2023-08-27 17:57:27 +0200
committerOliver Kiddle <opk@zsh.org>2023-09-20 20:08:12 +0200
commitbfc419e0c6dcc796b5171ae6c316fd60ffab8030 (patch)
tree608b0d0419be1e2c28aadc1f4e4dee842ff655f4
parentfa17566b658f8bc42f958a68ff9df634667b4def (diff)
downloadzsh-bfc419e0c6dcc796b5171ae6c316fd60ffab8030.tar.gz
zsh-bfc419e0c6dcc796b5171ae6c316fd60ffab8030.tar.xz
zsh-bfc419e0c6dcc796b5171ae6c316fd60ffab8030.zip
52102: Add subcommand autopurge to apt completion
Autopurge (like autoremove) take the same options like purge and remove the
given packages along with their dependencies they become unused.
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Debian/Command/_apt14
2 files changed, 8 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 6b1752c7c..44171d558 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2023-09-20  Oliver Kiddle  <opk@zsh.org>
 
+	* Jörg Sommer: 52102: Completion/Debian/Command/_apt:
+	Add subcommand autopurge to apt completion
+
 	* Wesley Schwengle: 52141: Completion/Unix/Command/_git: add trailer
 	token completion for git commit --trailer
 
diff --git a/Completion/Debian/Command/_apt b/Completion/Debian/Command/_apt
index 494d3bf82..19f818c27 100644
--- a/Completion/Debian/Command/_apt
+++ b/Completion/Debian/Command/_apt
@@ -422,15 +422,14 @@ _apt-cmd () {
 	/$'[^\0/=]#='/ /'[]'/ ':apt-package-versions:package version:_apt_versions_of_binary_package' \| \
       \) \
     \) \| \
-    /$'(remove|reinstall|purge)\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
+    /$'((|auto)(remove|purge)|reinstall)\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
     /$'upgrade\0'/ \| \
     /$'autoclean\0'/ \| \
     /$'changelog\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
-    /$'autoremove\0'/ \| \
     /$'full-upgrade\0'/ \| \
     /$'dist-upgrade\0'/ \| \
     /$'edit-sources\0'/ \| \
-    /"[]"/ ':argument-1::compadd "$expl_action[@]" list search showsrc show depends rdepends policy update install reinstall download source build-dep remove upgrade full-upgrade dist-upgrade edit-sources autoclean changelog autoremove purge'
+    /"[]"/ ':argument-1::compadd "$expl_action[@]" list search showsrc show depends rdepends policy update install reinstall download source build-dep remove upgrade full-upgrade dist-upgrade edit-sources autoclean changelog autopurge autoremove purge'
 
   _apt-cmd () {
     local expl_action expl_packages subcmd
@@ -487,19 +486,16 @@ _apt-get () {
 	/$'[^\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' \# \| \
+    /$'(|auto)(purge|remove)\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
     /$'dist-upgrade\0'/ \| \
     /$'dselect-upgrade\0'/ \| \
     /$'clean\0'/ \| \
     /$'autoclean\0'/ \| \
     /$'changelog\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
     /$'check\0'/ \| \
-    /$'autoremove\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
     /$'help\0/' \| \
-    /$'markauto\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
-    /$'unmarkauto\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
-    /"[]"/	':argument-1::compadd "$expl_action[@]" update upgrade install remove purge dist-upgrade dselect-upgrade clean autoclean changelog check source build-dep autoremove help markauto unmarkauto download'
+    /$'(|un)markauto\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
+    /"[]"/	':argument-1::compadd "$expl_action[@]" update upgrade install remove purge dist-upgrade dselect-upgrade clean autoclean changelog check source build-dep autopurge autoremove help markauto unmarkauto download'
 
   _apt-get () {
     local expl_action expl_packages