4 Commits

Author SHA1 Message Date
af686fe6c0 added summary of upgradable packages in "update" command 2024-09-30 12:01:55 +02:00
ba07f6275d updated README 2024-09-16 14:22:24 +02:00
8e2bdd88d3 simplified help output (wrong command) 2024-09-16 11:13:57 +02:00
8b23dc96a3 added function providefiles
list files provided by package
2024-08-01 02:02:52 +02:00
2 changed files with 45 additions and 20 deletions

View File

@@ -1,15 +1,23 @@
# pman.sh
A `pacman` helper script, because you forget the stupid flags
A `pacman` helper script, because you forget all the stupid flags
## Usage / Features:
- aur/yay
- search
- info
- localinfo
- provides
- providefiles
- installed
- install
- update
- upgradable
- upgrade
- install
- provides
- remove
- purge
- clean
- config
`config` is the only flag that is not appended to `pacman`, instead it resolves to `nano /etc/pacman.conf`.
`config` is the only flag that is not appended to `pacman` (or `yay`), instead it resolves to `nano /etc/pacman.conf`.
`sudo` gets prepended automatically if the command requires it and if installed - no, there is no check if your user is in the `sudo` group, if you download this script you should already be, or know you can only use part of this utility

49
pman.sh
View File

@@ -64,6 +64,15 @@ case "$command_args" in
su_needed=false
command_args="-F"
;;
"providefiles")
# Update the cache
su_needed=true
command_args="-Fy"
execute_command "${@}"
su_needed=false
command_args="-Fl"
;;
"installed")
command_args="-Q"
;;
@@ -78,6 +87,13 @@ case "$command_args" in
if [ "$command" = "pacman" ]; then
su_needed=true
fi
execute_command "${@}"
su_needed=false
command_args="-Qu"
echo
echo "$(execute_command "${@}" | wc -l) packages are available for update"
exit 0
;;
"upgradable")
command_args="-Qu"
@@ -108,26 +124,27 @@ case "$command_args" in
;;
*)
if [ "$more_arguments" = "true" ]; then
echo "Invalid command: \"$command $command_args\""
echo "Invalid command: \"$command_args\""
echo
echo "Usage: pman <command> [args...]"
echo "Available commands:"
echo " yay (aur) - yay | invoke yay "
echo " yay (aur) - yay | invoke yay "
echo " (aur packages - all the normal operations except config are available)"
echo " aur (yay) - yay | same as \"yay\""
echo " search - pacman -Ss | search packages"
echo " info - pacman -Si | show package information"
echo " localinfo - pacman -Qi | show local package information"
echo " provides - pacman -F | list packages that provide file"
echo " installed - pacman -Q | list installed packages"
echo " install - pacman -S | install packages"
echo " update - pacman -Sy | updates the repositories"
echo " upgradable - pacman -Qu | list available upgrades"
echo " upgrade - pacman -Syu | upgrades your system"
echo " remove - pacman -Rs | remove packages & dependencies"
echo " purge - pacman -Rns | remove packages, dependencies & conf"
echo " clean - pacman -Scc | remove all package files & trash"
echo " config - /etc/pacman.conf | edits pacman configuration"
echo " aur (yay) - yay | same as \"yay\""
echo " search - pacman -Ss | search packages"
echo " info - pacman -Si | show package information"
echo " localinfo - pacman -Qi | show local package information"
echo " provides - pacman -F | list packages that provide file"
echo " providefiles - pacman -Fl | list files provided by package"
echo " installed - pacman -Q | list installed packages"
echo " install - pacman -S | install packages"
echo " update - pacman -Sy | updates the repositories"
echo " upgradable - pacman -Qu | list available upgrades"
echo " upgrade - pacman -Syu | upgrades your system"
echo " remove - pacman -Rs | remove packages & dependencies"
echo " purge - pacman -Rns | remove packages, dependencies & conf"
echo " clean - pacman -Scc | remove all package files & trash"
echo " config - /etc/pacman.conf | edits pacman configuration"
exit 1
fi
;;