diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2019-02-06 03:44:14 +0000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2019-02-06 03:44:14 +0000 |
commit | 1cc6e78e771e415742a6b03973189d899d800396 (patch) | |
tree | 2528a8466f1e6ed2bf5de94ad72735837f1e657b /lsinitramfs | |
parent | 908bd7dc3528633baafa8ffbf97411f34bbd5c84 (diff) |
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 <ben@decadent.org.uk>
Diffstat (limited to 'lsinitramfs')
-rwxr-xr-x | lsinitramfs | 8 |
1 files changed, 4 insertions, 4 deletions
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 |