]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
[PATCH 09/50] Compact option processing.
authorVictor Lowther <victor.lowther@gmail.com>
Fri, 13 Feb 2009 12:41:52 +0000 (04:41 -0800)
committerDave Jones <davej@redhat.com>
Mon, 16 Feb 2009 18:56:40 +0000 (13:56 -0500)
Most of the options are one-liners, and the shift can be factored out of
the case expression entirely.

dracut

diff --git a/dracut b/dracut
index 0fe028279db215bc9996d30f00086b36126010a0..82cf9e575a16089d62c28f8eb87c011fdbeaa743 100755 (executable)
--- a/dracut
+++ b/dracut
 
 [ -f /etc/dracut.conf ] && . /etc/dracut.conf
 
-while [ $# -gt 0 ]; do
+while (($# > 0)); do
     case $1 in
-       -f|--force)
-           force=yes
-           shift
-           ;;
-       -h|--help)
-           echo "Usage: $0 [-f] <initramfs> <kernel-version>"
-           exit 1
-           ;;
-       -v|--verbose)
-           set -x
-           shift
-           ;;
-       -l|--local)
-           allowlocal="yes"
-           shift
-           ;;
-       --allow-missing)
-           shift
-           ;;
-       *)
-           break
+       -f|--force) force=yes;;
+       -h|--help) echo "Usage: $0 [-f] <initramfs> <kernel-version>"
+           exit 1 ;;
+       -v|--verbose) set -x;;
+       -l|--local) allowlocal="yes" ;;
+       --allow-missing) : ;;
+       *) break ;;
     esac
+    shift
 done
 
 if [ -n "$2" ]; then