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

@ -13,7 +13,7 @@
#
# The remove option -r $PACKAGENME will read the extracted files from ~/.local/bin/var/pkglist/$PACKAGENAME.lst and remove all this files.
# Also it will remove it self
#
#
# The -u option will read all ~/.local/bin/var/pkglist/*.lst files to gether the installed packages and reinstall them with the current package from the repository.
PACKAGE=$2
@ -24,11 +24,11 @@ usage()
cat <<EOF
Usage: $(basename $0) [options]
Options:
-h show this help page
-i $PACKAGENAME install package
-l list installed packages
-r $PACKAGENAME remove packagename
-u update all installed packages
-h show this help page
-i PACKAGENAME install package
-l list installed packages
-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