FEAT: Add Aptitude aliases

Why?:
- Aptitude is an alternative to apt with a great user interface, so there should
  also be some aliases that make using it as easy as with the apt aliases.

This change addresses the need by:
- Add new alias file aptitude.aliases.bash with most of the same Apt aliases
  instead using Aptitude
- Also add some new aliases for Aptitude specific features like "why-not"
pull/2195/head
Tobias Heinlein 2022-12-17 11:38:41 +01:00
parent feb468b517
commit a81fa84682
2 changed files with 36 additions and 4 deletions

View File

@ -0,0 +1,32 @@
# shellcheck shell=bash
#
# -binaryanomaly
cite 'about-alias'
about-alias 'Aptitude and dpkg aliases for Ubuntu and Debian distros.'
# set apt aliases
function _set_pkg_aliases() {
if _command_exists aptitude; then
alias apts='aptitude search'
alias aptshow='aptitude show'
alias aptinst='sudo aptitude install -V'
alias aptupd='sudo aptitude update'
alias aptsupg='sudo aptitude safe-upgrade'
alias aptupg='sudo apt-get dist-upgrade -V && sudo apt-get autoremove'
alias aptupgd='sudo apt-get update && sudo apt-get dist-upgrade -V && sudo apt-get autoremove'
alias aptrm='sudo aptitude remove'
alias aptpurge='sudo aptitude purge'
alias aptclean='sudo aptitude clean && sudo aptitude autoclean'
alias apty='aptitude why'
alias aptyn='aptitude why-not'
alias chkup='/usr/lib/update-notifier/apt-check -p --human-readable'
alias chkboot='cat /var/run/reboot-required'
alias pkgfiles='dpkg --listfiles'
alias listinstalled='aptitude search "~i!~M"'
fi
}
_set_pkg_aliases

View File

@ -259,7 +259,7 @@ function __check_completion () {
@test "completion bash-it: enable - provide the a* aliases when not enabled" {
run __check_completion 'bash-it enable alias a'
assert_line -n 0 "all ag ansible apt atom"
assert_line -n 0 "all ag ansible apt aptitude atom"
}
@test "completion bash-it: enable - provide the a* aliases when atom is enabled with the old location and name" {
@ -267,7 +267,7 @@ function __check_completion () {
assert_link_exist "$BASH_IT/aliases/enabled/atom.aliases.bash"
run __check_completion 'bash-it enable alias a'
assert_line -n 0 "all ag ansible apt"
assert_line -n 0 "all ag ansible apt aptitude"
}
@test "completion bash-it: enable - provide the a* aliases when atom is enabled with the old location and priority-based name" {
@ -275,7 +275,7 @@ function __check_completion () {
assert_link_exist "$BASH_IT/aliases/enabled/150---atom.aliases.bash"
run __check_completion 'bash-it enable alias a'
assert_line -n 0 "all ag ansible apt"
assert_line -n 0 "all ag ansible apt aptitude"
}
@test "completion bash-it: enable - provide the a* aliases when atom is enabled with the new location and priority-based name" {
@ -283,7 +283,7 @@ function __check_completion () {
assert_link_exist "$BASH_IT/enabled/150---atom.aliases.bash"
run __check_completion 'bash-it enable alias a'
assert_line -n 0 "all ag ansible apt"
assert_line -n 0 "all ag ansible apt aptitude"
}
@test "completion bash-it: enable - provide the docker* plugins when docker-compose is enabled with the old location and name" {