summaryrefslogtreecommitdiffstats
path: root/lsinitcpio
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-04-19 00:53:48 +0200
committerDave Reisner <dreisner@archlinux.org>2012-04-22 05:43:52 +0200
commit4d8a616496b4b46b957cd89f037edfb2ca19e89d (patch)
treeaab38cee630830b02e7e32c25841bdc573d4ca45 /lsinitcpio
parentd13917104528fba28cd110373f130b3149002782 (diff)
downloadmkinitcpio-4d8a616496b4b46b957cd89f037edfb2ca19e89d.tar.gz
mkinitcpio-4d8a616496b4b46b957cd89f037edfb2ca19e89d.tar.xz
lsinitcpio: avoid exiting from usage
Print a more helpful message when no image is specified. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'lsinitcpio')
-rwxr-xr-xlsinitcpio8
1 files 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] <initramfs>
-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