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