From 0d99859add525d5ac40a4bbf04b447899c3104be Mon Sep 17 00:00:00 2001 From: wcbing Date: Wed, 21 May 2025 12:02:54 +0800 Subject: [PATCH] completions/apt & apt-get: Let autoremove and autopurge take packages - add complete for apt-get's autopurge - continue #7095, add complete for apt/apt-get's autoremove and autopurge --- share/completions/apt-get.fish | 7 ++++--- share/completions/apt.fish | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/share/completions/apt-get.fish b/share/completions/apt-get.fish index 71f040f12..51f671dfe 100644 --- a/share/completions/apt-get.fish +++ b/share/completions/apt-get.fish @@ -2,7 +2,7 @@ function __fish_apt_no_subcommand -d 'Test if apt has yet to be given the subcommand' for i in (commandline -xpc) - if contains -- $i update upgrade dselect-upgrade dist-upgrade install remove purge source build-dep check clean autoclean changelog + if contains -- $i update upgrade dselect-upgrade dist-upgrade install remove purge autoremove autopurge source build-dep check clean autoclean changelog return 1 end end @@ -11,7 +11,7 @@ end function __fish_apt_use_package -d 'Test if apt command should have packages as potential completion' for i in (commandline -xpc) - if contains -- $i contains install remove purge build-dep changelog + if contains -- $i contains install remove purge autoremove autopurge build-dep changelog return 0 end end @@ -34,7 +34,8 @@ complete -f -n __fish_apt_no_subcommand -c apt-get -a build-dep -d 'Install/remo complete -f -n __fish_apt_no_subcommand -c apt-get -a check -d 'Update cache and check dependencies' complete -f -n __fish_apt_no_subcommand -c apt-get -a clean -d 'Clean local caches and packages' complete -f -n __fish_apt_no_subcommand -c apt-get -a autoclean -d 'Clean packages no longer be downloaded' -complete -f -n __fish_apt_no_subcommand -c apt-get -a autoremove -d 'Remove automatically installed packages' +complete -f -n __fish_apt_no_subcommand -c apt-get -a autoremove -d 'Remove packages no longer needed as dependencies' +complete -f -n __fish_apt_no_subcommand -c apt-get -a autopurge -d 'Remove packages no longer needed as dependencies and delete their config files' complete -c apt-get -l no-install-recommends -d 'Do not install recommended packages' complete -c apt-get -l no-install-suggests -d 'Do not install suggested packages' complete -c apt-get -s d -l download-only -d 'Download Only' diff --git a/share/completions/apt.fish b/share/completions/apt.fish index cd043274b..9dd92e227 100644 --- a/share/completions/apt.fish +++ b/share/completions/apt.fish @@ -6,8 +6,8 @@ if [ "$(uname -s)" = Darwin -a "$(command -s apt)" = /usr/bin/apt ] exit 1 end -set -l all_subcmds update upgrade full-upgrade search list install show remove edit-sources purge changelog autoremove depends rdepends -set -l pkg_subcmds install upgrade full-upgrade show search purge changelog policy depends rdepends autoremove +set -l all_subcmds update upgrade full-upgrade search list install show remove edit-sources purge changelog autoremove autopurge depends rdepends +set -l pkg_subcmds install upgrade full-upgrade show search purge changelog policy depends rdepends autoremove autopurge set -l installed_pkg_subcmds remove set -l handle_file_pkg_subcmds install @@ -114,7 +114,7 @@ __fish_apt_subcommand changelog -r -d 'Download and display package changelog' # Autoremove __fish_apt_subcommand autoremove -d 'Remove packages no longer needed as dependencies' -# Autoremove +# Autopurge __fish_apt_subcommand autopurge -d 'Remove packages no longer needed as dependencies and delete their config files' # Clean