aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2015-08-29 22:21:30 +0100
committerFrancis Rowe <info@gluglug.org.uk>2015-08-29 22:21:30 +0100
commit6974f807a406aa3fdde07c990511ca47f9f168a9 (patch)
tree9884c0e821dc3ec369b8db3b37ccd5cd93a6caae
parentd63a420737a5811b4f1c5a4e2da4782f50e60a9d (diff)
downloadlibrebootfr-6974f807a406aa3fdde07c990511ca47f9f168a9.tar.gz
librebootfr-6974f807a406aa3fdde07c990511ca47f9f168a9.zip
download script: show help text if no argument is given
-rwxr-xr-xdownload20
1 files changed, 12 insertions, 8 deletions
diff --git a/download b/download
index 752edd4a..b9664c8f 100755
--- a/download
+++ b/download
@@ -27,12 +27,22 @@ download=./resources/scripts/helpers/download
programmes=$(ls ${download}/)
noconfirm="0"
+help () {
+ printf "%s\n\n" "./download programme(s) # programmes are space separated, if specifing multiple programmes"
+ printf "possible values for 'programmes':\nall:\n%s\n\n" "${programmes}"
+ printf "Example (download everything): ./download all\n"
+ printf "Example (download flashrom): ./download flashrom\n"
+ printf "Example (download coreboot): ./download coreboot\n"
+ printf "Example (download coreboot and flashrom): ./download coreboot flashrom\n"
+ printf "Example (lists all available downloadable components): ./download list\n"
+}
+
if [ $# -lt 1 ]; then
printf "ERROR: download script: no argmunt given.\n"
+ help
exit 1
fi
-
if [ "${1}" = "--noconfirm" ] || [ "${1}" = "-y" ]; then
noconfirm="1"
shift 1
@@ -46,13 +56,7 @@ case ${@} in
exit
;;
help)
- printf "%s\n\n" "./download programme(s) # programmes are space separated, if specifing multiple programmes"
- printf "possible values for 'programmes':\nall:\n%s\n\n" "${programmes}"
- printf "Example (download everything): ./download all\n"
- printf "Example (download flashrom): ./download flashrom\n"
- printf "Example (download coreboot): ./download coreboot\n"
- printf "Example (download coreboot and flashrom): ./download coreboot flashrom\n"
- printf "Example (lists all available downloadable components): ./download list\n"
+ help
exit
;;
*)