#!/bin/bash # -*- shell-script -*- # qemu-sanity-check # Copyright (C) 2013 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Handle command line parsing. function usage { echo "qemu-sanity-check [options]" echo "Options:" echo " --help Display this help" echo " --version Display version and exit" exit 0 } TEMP=$(getopt \ -o v \ --long help \ --long version \ -n 'qemu-sanity-check' -- "$@") if [ $? != 0 ]; then exit 1; fi eval set -- "$TEMP" while true; do case "$1" in --help) usage ;; -v|--version) echo "@PACKAGE_NAME@ @PACKAGE_VERSION@"; exit 0 ;; --) shift; break ;; *) fail "internal error ($1)" ;; esac done