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