]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
lsinitrd.sh: print usage for -?, -h
authorHarald Hoyer <harald@redhat.com>
Tue, 3 Jul 2012 16:23:27 +0000 (18:23 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 3 Jul 2012 16:23:27 +0000 (18:23 +0200)
lsinitrd.sh

index e6767dcfcb9ada6dcfcc0283600f7c7439d6b1c0..f27f7558905c7dd052b30e4d793b1ec15e37a280 100755 (executable)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-[[ $# -le 2 ]] || { echo "Usage: $(basename $0) [-s] [<initramfs file> [<filename>]]" ; exit 1 ; }
+usage()
+{
+    echo "Usage: $(basename $0) [-s] [<initramfs file> [<filename>]]"
+}
+
+[[ $# -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))