From f12d694790f21241e79fc27dc8eb45d8d6451268 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Mon, 24 Apr 2023 07:02:39 +0200 Subject: [PATCH] update usage messages --- usr/bin/archboot-binary-check.sh | 3 ++- usr/bin/archboot-copy-mountpoint.sh | 4 ++-- usr/bin/archboot-cpio.sh | 10 +++++----- usr/bin/archboot-hwsim.sh | 1 + usr/bin/archboot-restore-usbstick.sh | 2 +- usr/bin/archboot-rsync-backup.sh | 4 ++-- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/usr/bin/archboot-binary-check.sh b/usr/bin/archboot-binary-check.sh index 8149a1f76..39e4dd768 100755 --- a/usr/bin/archboot-binary-check.sh +++ b/usr/bin/archboot-binary-check.sh @@ -5,9 +5,10 @@ _APPNAME=${0##*/} _usage () { echo "Check on missing binaries in archboot environment" echo "-------------------------------------------------" - echo "usage: ${_APPNAME} " echo "This will check binaries from package, if they exist" echo "and report missing to binary.txt" + echo "" + echo "usage: ${_APPNAME} " exit 0 } [[ -z "${1}" ]] && _usage diff --git a/usr/bin/archboot-copy-mountpoint.sh b/usr/bin/archboot-copy-mountpoint.sh index b44b526e3..ecccf9f52 100755 --- a/usr/bin/archboot-copy-mountpoint.sh +++ b/usr/bin/archboot-copy-mountpoint.sh @@ -16,11 +16,11 @@ _usage() echo -e " for each additional mountpoint eg. \e[1m/boot\e[m or \e[1m/home\e[m." echo "" echo -e "usage: \e[1m${_APPNAME} \e[m" - exit "$1" + exit 0 } ################################################## if [ $# -ne 2 ]; then - _usage 1 + _usage fi _NEWMOUNTPOINT="${2}" _OLDMOUNTPOINT="${1}" diff --git a/usr/bin/archboot-cpio.sh b/usr/bin/archboot-cpio.sh index 34ad82240..68998a87d 100755 --- a/usr/bin/archboot-cpio.sh +++ b/usr/bin/archboot-cpio.sh @@ -30,11 +30,11 @@ ARCHBOOT CPIO ------------- Tool for creating archboot initramfs images. --c Use config file --g Generate cpio image and write to specified path --h Display this message and exit --k Use specified kernel --d Write generated image into + -c Use config file + -g Generate cpio image and write to specified path + -h Display this message and exit + -k Use specified kernel + -d Write generated image into usage: ${0##*/} EOF diff --git a/usr/bin/archboot-hwsim.sh b/usr/bin/archboot-hwsim.sh index 0b86a6795..1e2a0a556 100755 --- a/usr/bin/archboot-hwsim.sh +++ b/usr/bin/archboot-hwsim.sh @@ -14,6 +14,7 @@ _usage() echo "with mac80211_hwsim module." echo "- wlan0 will be setup as the AP. Don't use for scanning!" echo "- wlan1 will be setup for STATION mode. Use this for scanning for your AP." + echo "" echo -e "usage: \e[1m${_APPNAME} \e[m" exit 0 } diff --git a/usr/bin/archboot-restore-usbstick.sh b/usr/bin/archboot-restore-usbstick.sh index ccbd5664e..1ee6019bc 100755 --- a/usr/bin/archboot-restore-usbstick.sh +++ b/usr/bin/archboot-restore-usbstick.sh @@ -14,7 +14,7 @@ _usage() echo -e "\e[91mWARNING: ALL DATA WILL BE LOST ON THE DEVICE! \e[m" echo "" echo -e "usage: \e[1m${_APPNAME} \e[m" - exit "1" + exit 0 } ################################################## [[ -z "${1}" ]] && _usage "$@" diff --git a/usr/bin/archboot-rsync-backup.sh b/usr/bin/archboot-rsync-backup.sh index 9e550499e..440943c23 100755 --- a/usr/bin/archboot-rsync-backup.sh +++ b/usr/bin/archboot-rsync-backup.sh @@ -17,11 +17,11 @@ _usage() echo -e "- \e[1m--numeric-ids\e[m option is invoked to \e[1mpreserve\e[m users" echo "" echo -e "usage: \e[1m${_APPNAME} \e[m" - exit "$1" + exit 0 } ################################################## if [ $# -ne 2 ]; then - _usage 1 + _usage fi _BACKUPDESTINATION="${2}" _BACKUPDIR="${1}"