From 1cc6e78e771e415742a6b03973189d899d800396 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 6 Feb 2019 03:44:14 +0000 Subject: lsinitramfs: Check for empty list of arguments after parsing options If "lsinitramfs" with no arguments is invalid, "lsinitramfs -l" should be too. Signed-off-by: Ben Hutchings --- lsinitramfs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lsinitramfs') diff --git a/lsinitramfs b/lsinitramfs index c106697..5b3315f 100755 --- a/lsinitramfs +++ b/lsinitramfs @@ -22,10 +22,6 @@ usage_error() exit 2 } -if [ "$#" -eq 0 ] ; then - usage_error -fi - umi_opts="--list" OPTIONS=$(getopt -o hl --long help,long -n "$0" -- "$@") || usage_error @@ -52,6 +48,10 @@ while true; do esac done +if [ "$#" -eq 0 ] ; then + usage_error +fi + for initramfs in "$@" ; do unmkinitramfs $umi_opts -- "$initramfs" done -- cgit v1.2.3