changed input variable name

This commit is contained in:
Bryan Joshua Pedini 2023-05-06 03:18:02 +02:00
parent 6455b904c4
commit fc0983dbb4

20
pman.sh
View File

@ -1,37 +1,37 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Store the first command line argument in the variable "command" and shift the rest # Store the first command line argument in the variable "command" and shift the rest
command="$1" command_args="$1"
shift shift
# Evaluate the command # Evaluate the command arguments
if [ "$command" = "search" ]; then if [ "$command_args" = "search" ]; then
command="pacman" command="pacman"
command_args="-Ss" command_args="-Ss"
elif [ "$command" = "update" ]; then elif [ "$command_args" = "update" ]; then
command="pacman" command="pacman"
command_args="-Sy" command_args="-Sy"
su_needed=true su_needed=true
elif [ "$command" = "upgradable" ]; then elif [ "$command_args" = "upgradable" ]; then
command="pacman" command="pacman"
command_args="-Qu" command_args="-Qu"
elif [ "$command" = "upgrade" ]; then elif [ "$command_args" = "upgrade" ]; then
command="pacman" command="pacman"
command_args="-Syu" command_args="-Syu"
su_needed=true su_needed=true
elif [ "$command" = "install" ]; then elif [ "$command_args" = "install" ]; then
command="pacman" command="pacman"
command_args="-S" command_args="-S"
su_needed=true su_needed=true
elif [ "$command" = "provides" ]; then elif [ "$command_args" = "provides" ]; then
command="pacman" command="pacman"
command_args="-F" command_args="-F"
elif [ "$command" = "config" ]; then elif [ "$command_args" = "config" ]; then
command="nano" command="nano"
command_args="/etc/pacman.conf" command_args="/etc/pacman.conf"
su_needed=true su_needed=true
else else
echo "Invalid command: \"$command\"" echo "Invalid command: \"$command_args\""
echo echo
echo "Usage: pman <command> [args...]" echo "Usage: pman <command> [args...]"
echo "Available commands:" echo "Available commands:"