Compare commits

..

3 Commits

50
pman.sh
View File

@ -45,9 +45,17 @@ if [ "$command" = "" ]; then
fi fi
# Evaluate the command arguments # Evaluate the command arguments
if [ "$command_args" = "search" ]; then case "$command_args" in
"search")
command_args="-Ss" command_args="-Ss"
elif [ "$command_args" = "provides" ]; then ;;
"info")
command_args="-Si"
;;
"localinfo")
command_args="-Qi"
;;
"provides")
# Update the cache # Update the cache
su_needed=true su_needed=true
command_args="-Fy" command_args="-Fy"
@ -55,36 +63,51 @@ elif [ "$command_args" = "provides" ]; then
su_needed=false su_needed=false
command_args="-F" command_args="-F"
elif [ "$command_args" = "installed" ]; then ;;
"installed")
command_args="-Q" command_args="-Q"
elif [ "$command_args" = "install" ]; then ;;
"install")
command_args="-S" command_args="-S"
if [ "$command" = "pacman" ]; then if [ "$command" = "pacman" ]; then
su_needed=true su_needed=true
fi fi
elif [ "$command_args" = "update" ]; then ;;
"update")
command_args="-Sy" command_args="-Sy"
if [ "$command" = "pacman" ]; then if [ "$command" = "pacman" ]; then
su_needed=true su_needed=true
fi fi
elif [ "$command_args" = "upgradable" ]; then ;;
"upgradable")
command_args="-Qu" command_args="-Qu"
elif [ "$command_args" = "upgrade" ]; then ;;
"upgrade")
command_args="-Syu" command_args="-Syu"
if [ "$command" = "pacman" ]; then if [ "$command" = "pacman" ]; then
su_needed=true su_needed=true
fi fi
elif [ "$command_args" = "remove" ]; then ;;
"remove")
command_args="-Rs" command_args="-Rs"
if [ "$command" = "pacman" ]; then if [ "$command" = "pacman" ]; then
su_needed=true su_needed=true
fi fi
elif [ "$command_args" = "purge" ]; then ;;
"purge")
command_args="-Rns" command_args="-Rns"
if [ "$command" = "pacman" ]; then if [ "$command" = "pacman" ]; then
su_needed=true su_needed=true
fi fi
elif [ "$more_arguments" = "true" ]; then ;;
"clean")
command_args="-Scc"
if [ "$command" = "pacman" ]; then
su_needed=true
fi
;;
*)
if [ "$more_arguments" = "true" ]; then
echo "Invalid command: \"$command $command_args\"" echo "Invalid command: \"$command $command_args\""
echo echo
echo "Usage: pman <command> [args...]" echo "Usage: pman <command> [args...]"
@ -93,6 +116,8 @@ elif [ "$more_arguments" = "true" ]; then
echo " (aur packages - all the normal operations except config are available)" echo " (aur packages - all the normal operations except config are available)"
echo " aur (yay) - yay | same as \"yay\"" echo " aur (yay) - yay | same as \"yay\""
echo " search - pacman -Ss | search packages" 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 " provides - pacman -F | list packages that provide file"
echo " installed - pacman -Q | list installed packages" echo " installed - pacman -Q | list installed packages"
echo " install - pacman -S | install packages" echo " install - pacman -S | install packages"
@ -101,8 +126,11 @@ elif [ "$more_arguments" = "true" ]; then
echo " upgrade - pacman -Syu | upgrades your system" echo " upgrade - pacman -Syu | upgrades your system"
echo " remove - pacman -Rs | remove packages & dependencies" echo " remove - pacman -Rs | remove packages & dependencies"
echo " purge - pacman -Rns | remove packages, dependencies & conf" 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 " config - /etc/pacman.conf | edits pacman configuration"
exit 1 exit 1
fi fi
;;
esac
execute_command "${@}" execute_command "${@}"