From 774301853331e060f1a5f9f30ad36c87dd291217 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 19 Apr 2016 14:18:18 -0700 Subject: update.sh: exit with success whenever help is specified Unix commands usually exit successfully when help was explicitly asked for. However, in case arguments are incomplete or otherwise wrong, exit with error. Signed-off-by: Stefan Agner Acked-by: Marcel Ziswiler --- recipes/images/files/colibri-imx7/update.sh | 6 +----- recipes/images/files/colibri-vf/update.sh | 6 +----- recipes/images/files/library/imx6/update.sh | 6 +----- recipes/images/files/library/tegra/update.sh | 6 +----- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/recipes/images/files/colibri-imx7/update.sh b/recipes/images/files/colibri-imx7/update.sh index e7ce607..857159f 100755 --- a/recipes/images/files/colibri-imx7/update.sh +++ b/recipes/images/files/colibri-imx7/update.sh @@ -75,10 +75,6 @@ while getopts "dfhno:s" Option ; do exit 0 ;; h) Usage - # Exit if only usage (-h) was specified. - if [ "$#" -eq 1 ] ; then - exit 10 - fi exit 0 ;; o) OUT_DIR=$OPTARG @@ -88,7 +84,7 @@ done if [ "$OUT_DIR" = "" ] && [ "$UBOOT_RECOVERY" = "0" ] ; then Usage - exit 0 + exit 1 fi # is OUT_DIR an existing directory? diff --git a/recipes/images/files/colibri-vf/update.sh b/recipes/images/files/colibri-vf/update.sh index f3881b4..b0611bc 100755 --- a/recipes/images/files/colibri-vf/update.sh +++ b/recipes/images/files/colibri-vf/update.sh @@ -83,10 +83,6 @@ while getopts "d:fhno:s" Option ; do exit 0 ;; h) Usage - # Exit if only usage (-h) was specified. - if [ "$#" -eq 1 ] ; then - exit 10 - fi exit 0 ;; n) NORTSCTS=1 @@ -100,7 +96,7 @@ done if [ "$OUT_DIR" = "" ] && [ "$UBOOT_RECOVERY" = "0" ] ; then Usage - exit 0 + exit 1 fi # is OUT_DIR an existing directory? diff --git a/recipes/images/files/library/imx6/update.sh b/recipes/images/files/library/imx6/update.sh index e5735f9..c3f3903 100755 --- a/recipes/images/files/library/imx6/update.sh +++ b/recipes/images/files/library/imx6/update.sh @@ -81,10 +81,6 @@ while getopts "cdfho:" Option ; do exit 0 ;; h) Usage - # Exit if only usage (-h) was specified. - if [ "$#" -eq 1 ] ; then - exit 10 - fi exit 0 ;; o) OUT_DIR=$OPTARG @@ -94,7 +90,7 @@ done if [ "$OUT_DIR" = "" ] && [ "$UBOOT_RECOVERY" = "0" ] ; then Usage - exit 0 + exit 1 fi # is OUT_DIR an existing directory? diff --git a/recipes/images/files/library/tegra/update.sh b/recipes/images/files/library/tegra/update.sh index ea122ea..76e7c6c 100755 --- a/recipes/images/files/library/tegra/update.sh +++ b/recipes/images/files/library/tegra/update.sh @@ -100,10 +100,6 @@ while getopts "b:cdfho:r:sv:" Option ; do exit 0 ;; h) Usage - # Exit if only usage (-h) was specified. - if [ "$#" -eq 1 ] ; then - exit 10 - fi exit 0 ;; o) OUT_DIR=$OPTARG @@ -120,7 +116,7 @@ done if [ "$OUT_DIR" = "" ] && [ "$UBOOT_RECOVERY" = "0" ] ; then Usage - exit 0 + exit 1 fi # is OUT_DIR an existing directory? -- cgit v1.2.3