From 4d8a616496b4b46b957cd89f037edfb2ca19e89d Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 18 Apr 2012 18:53:48 -0400 Subject: lsinitcpio: avoid exiting from usage Print a more helpful message when no image is specified. Signed-off-by: Dave Reisner --- lsinitcpio | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lsinitcpio b/lsinitcpio index 55ce1e8..54ff534 100755 --- a/lsinitcpio +++ b/lsinitcpio @@ -24,7 +24,6 @@ usage: ${0##*/} [options] -x, --extract extract image to disk USAGE - exit 1 } decomp() { @@ -75,7 +74,8 @@ while :; do -a|--analyze) analyze=1 ;; -h|--help) - usage ;; + usage + exit 0 ;; -n|--nocolor) color=0 ;; -v|--verbose) @@ -111,8 +111,8 @@ if [[ -t 1 ]] && (( color )); then fi readonly NC BOLD BLUE GREEN RED YELLOW -[[ $image ]] || usage -[[ -f $image ]] || die "$image: No such file" +[[ $image ]] || die "No image specified (use -h for help)" +[[ -f $image ]] || die "No such file: $image" # read compression type case "$(file -Lb "$image")" in -- cgit v1.2.3-24-g4f1b