summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2017-09-24 23:31:16 +0200
committerGravatar Christian Hesse <mail@eworm.de>2017-09-24 23:44:32 +0200
commitdf10bb52910ae614ed9dce88540be7f7058cb1c5 (patch)
treeb6ae39c107c595fbfb41f0382a97b382845f4f6e
parentb0b0e857759e72530c347f077ca5923ac757d78f (diff)
downloadpacman-offline-df10bb52910ae614ed9dce88540be7f7058cb1c5.tar.gz
pacman-offline-df10bb52910ae614ed9dce88540be7f7058cb1c5.tar.zst
add refresh and help options
-rwxr-xr-xbin/pacman-offline19
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/pacman-offline b/bin/pacman-offline
index 33b2461..aae47ef 100755
--- a/bin/pacman-offline
+++ b/bin/pacman-offline
@@ -2,6 +2,25 @@
set -e
+function help() {
+ echo "usage: ${0} [OPTIONS]"
+ echo
+ echo ' -h this help'
+ echo ' -y update sync databases'
+}
+
+while getopts 'hy' opt; do
+ case ${opt} in
+ h)
+ help
+ exit 0
+ ;;
+ y)
+ pacman -Sy
+ ;;
+ esac
+done
+
# check for available updates
if ! pacman -Qu >/dev/null; then
echo "No updates available."