fix: requesting --help is not an error

This commit is contained in:
Martin Wimpress 2024-07-02 13:20:30 +01:00 committed by Martin Wimpress
parent 66dfa6451a
commit 8cf007f8eb
1 changed files with 8 additions and 4 deletions

View File

@ -1633,7 +1633,6 @@ function usage() {
echo " --sound-duplex <type> : Set sound card duplex. @Options: 'hda-micro' (default: speaker/mic), 'hda-duplex' (line-in/line-out), 'hda-output' (output-only)" echo " --sound-duplex <type> : Set sound card duplex. @Options: 'hda-micro' (default: speaker/mic), 'hda-duplex' (line-in/line-out), 'hda-output' (output-only)"
echo " --extra_args <arguments> : Pass additional arguments to qemu" echo " --extra_args <arguments> : Pass additional arguments to qemu"
echo " --version : Print version" echo " --version : Print version"
exit 1
} }
function display_param_check() { function display_param_check() {
@ -1921,6 +1920,7 @@ fi
# Take command line arguments # Take command line arguments
if [ $# -lt 1 ]; then if [ $# -lt 1 ]; then
usage usage
exit 1
else else
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case "${1}" in case "${1}" in
@ -2066,10 +2066,12 @@ else
echo "${VERSION}" echo "${VERSION}"
exit;; exit;;
-h|--h|-help|--help) -h|--h|-help|--help)
usage;; usage
exit 0;;
*) *)
echo "ERROR! \"${1}\" is not a supported parameter." echo "ERROR! \"${1}\" is not a supported parameter."
usage;; usage
exit 1;;
esac esac
done done
fi fi
@ -2134,12 +2136,14 @@ if [ -n "${VM}" ] && [ -e "${VM}" ]; then
exit;; exit;;
*) *)
echo "ERROR! \"${SNAPSHOT_ACTION}\" is not a supported snapshot action." echo "ERROR! \"${SNAPSHOT_ACTION}\" is not a supported snapshot action."
usage;; usage
exit 1;;
esac esac
fi fi
else else
echo "ERROR! Virtual machine configuration not found." echo "ERROR! Virtual machine configuration not found."
usage usage
exit 1
fi fi
display_param_check display_param_check