From df10bb52910ae614ed9dce88540be7f7058cb1c5 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sun, 24 Sep 2017 23:31:16 +0200 Subject: add refresh and help options --- bin/pacman-offline | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'bin') 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." -- cgit v1.2.3-70-g09d2