From: Victor Lowther Date: Fri, 13 Feb 2009 12:41:52 +0000 (-0800) Subject: [PATCH 09/50] Compact option processing. X-Git-Tag: 0.1~469 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b368a5f3bb58a795210f4caf3ad43a2757e3d651;p=thirdparty%2Fdracut.git [PATCH 09/50] Compact option processing. Most of the options are one-liners, and the shift can be factored out of the case expression entirely. --- diff --git a/dracut b/dracut index 0fe028279..82cf9e575 100755 --- a/dracut +++ b/dracut @@ -10,30 +10,17 @@ [ -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] " - 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] " + exit 1 ;; + -v|--verbose) set -x;; + -l|--local) allowlocal="yes" ;; + --allow-missing) : ;; + *) break ;; esac + shift done if [ -n "$2" ]; then