summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorShahed Hosseini <sajjadhusseini92@gmail.com>2021-12-29 13:28:47 +0330
committerGitHub <noreply@github.com>2021-12-29 10:58:47 +0100
commitb38da62b23e08271fad9fc25a0bb47e89215a431 (patch)
treebd7b5b9bcc31747c1f48c789b8682010d1f5c8a4 /plugins
parentd384ccf31dca8b0a768c463087f156b7302c77c5 (diff)
downloadzsh-b38da62b23e08271fad9fc25a0bb47e89215a431.tar.gz
zsh-b38da62b23e08271fad9fc25a0bb47e89215a431.tar.bz2
zsh-b38da62b23e08271fad9fc25a0bb47e89215a431.zip
feat(debian): add `aar` alias for autoremove (#7869)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/debian/debian.plugin.zsh9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh
index bde97cd30..1d2022436 100644
--- a/plugins/debian/debian.plugin.zsh
+++ b/plugins/debian/debian.plugin.zsh
@@ -52,9 +52,11 @@ if [[ $use_sudo -eq 1 ]]; then
alias ai="sudo $apt_pref install"
# Install all packages given on the command line while using only the first word of each line:
# acs ... | ail
+
alias ail="sed -e 's/ */ /g' -e 's/ *//' | cut -s -d ' ' -f 1 | xargs sudo $apt_pref install"
alias ap="sudo $apt_pref purge"
alias ar="sudo $apt_pref remove"
+ alias aar="sudo $apt_pref autoremove"
# apt-get only
alias ads="sudo apt-get dselect-upgrade"
@@ -98,7 +100,11 @@ else
print "$cmd"
eval "$cmd"
}
-
+ aar() {
+ cmd="su -lc '$apt_pref -P autoremove $@' root"
+ print "$cmd"
+ eval "$cmd"
+ }
# Install all .deb files in the current directory
# Assumes glob_subst is off
alias dia='su -lc "dpkg -i ./*.deb" root'
@@ -139,6 +145,7 @@ apt_pref_compdef ai "install"
apt_pref_compdef ail "install"
apt_pref_compdef ap "purge"
apt_pref_compdef ar "remove"
+apt_pref_compdef aar "autoremove"
apt_pref_compdef ads "dselect-upgrade"
# Misc. #####################################################################