b38da62b23e08271fad9fc25a0bb47e89215a431

Author
Shahed Hosseini <sajjadhusseini92@gmail.com>
Committer
GitHub <noreply@github.com>
Date

Message

feat(debian): add `aar` alias for autoremove (#7869)

Diff

 1diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh
 2index bde97cd308a422258e32902653dca0feba687b49..1d202243607a1961d57f5a99c9a9c76554f00db2 100644
 3--- a/plugins/debian/debian.plugin.zsh
 4+++ b/plugins/debian/debian.plugin.zsh
 5@@ -52,9 +52,11 @@ if [[ $use_sudo -eq 1 ]]; then
 6     alias ai="sudo $apt_pref install"
 7     # Install all packages given on the command line while using only the first word of each line:
 8     # acs ... | ail
 9+
10     alias ail="sed -e 's/  */ /g' -e 's/ *//' | cut -s -d ' ' -f 1 | xargs sudo $apt_pref install"
11     alias ap="sudo $apt_pref purge"
12     alias ar="sudo $apt_pref remove"
13+    alias aar="sudo $apt_pref autoremove"
14 
15     # apt-get only
16     alias ads="sudo apt-get dselect-upgrade"
17@@ -98,7 +100,11 @@ else
18         print "$cmd"
19         eval "$cmd"
20     }
21-
22+    aar() {
23+        cmd="su -lc '$apt_pref -P autoremove $@' root"
24+        print "$cmd"
25+        eval "$cmd"
26+    }
27     # Install all .deb files in the current directory
28     # Assumes glob_subst is off
29     alias dia='su -lc "dpkg -i ./*.deb" root'
30@@ -139,6 +145,7 @@ apt_pref_compdef ai  "install"
31 apt_pref_compdef ail "install"
32 apt_pref_compdef ap  "purge"
33 apt_pref_compdef ar  "remove"
34+apt_pref_compdef aar  "autoremove"
35 apt_pref_compdef ads "dselect-upgrade"
36 
37 # Misc. #####################################################################