Compare commits

..

3 Commits

144
pman.sh
View File

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