From: Harald Hoyer Date: Tue, 3 Jul 2012 16:23:27 +0000 (+0200) Subject: lsinitrd.sh: print usage for -?, -h X-Git-Tag: 021~76 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f7bccf3724834ca42b2521f0367291219314a09a;p=thirdparty%2Fdracut.git lsinitrd.sh: print usage for -?, -h --- diff --git a/lsinitrd.sh b/lsinitrd.sh index e6767dcfc..f27f75589 100755 --- a/lsinitrd.sh +++ b/lsinitrd.sh @@ -19,13 +19,19 @@ # along with this program. If not, see . # -[[ $# -le 2 ]] || { echo "Usage: $(basename $0) [-s] [ []]" ; exit 1 ; } +usage() +{ + echo "Usage: $(basename $0) [-s] [ []]" +} + +[[ $# -le 2 ]] || { usage ; exit 1 ; } sorted=0 while getopts "s" opt; do case $opt in s) sorted=1;; - \?) exit 1;; + h) usage; exit 0;; + \?) usage; exit 1;; esac done shift $((OPTIND-1))