update script

add echo help if no package is set to install or remove
This commit is contained in:
Kaisa Marysia 2025-08-01 09:58:18 +02:00
parent 0af2552546
commit 6f77f53988

View file

@ -25,9 +25,9 @@ cat <<EOF
Usage: $(basename $0) [options]
Options:
-h show this help page
-i $PACKAGENAME install package
-i PACKAGENAME install package
-l list installed packages
-r $PACKAGENAME remove packagename
-r PACKAGENAME remove packagename
-u update all installed packages
EOF
@ -85,11 +85,13 @@ function list() {
if [[ "$source" == "install" ]]; then
if [ -z "$PACKAGE" ]; then
echo "see -h for usage"
exit 1
fi
install $PACKAGE
elif [[ "$source" == "remove" ]]; then
if [ -z "$PACKAGE" ]; then
echo "see -h for usage"
exit 1
fi
remove $PACKAGE
@ -100,4 +102,6 @@ elif [[ "$source" == "list" ]]; then
list
elif [[ "$source" == "update" ]]; then
update
elif [[ -z "$source" ]]; then
echo "see -h for usage"
fi