update script
add echo help if no package is set to install or remove
This commit is contained in:
parent
0af2552546
commit
6f77f53988
1 changed files with 10 additions and 6 deletions
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue