From 8cf007f8ebd8a477668dbf351484d85b5e0ab0f7 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Tue, 2 Jul 2024 13:20:30 +0100 Subject: [PATCH] fix: requesting --help is not an error --- quickemu | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/quickemu b/quickemu index 42718ad..c489fa9 100755 --- a/quickemu +++ b/quickemu @@ -1633,7 +1633,6 @@ function usage() { echo " --sound-duplex : Set sound card duplex. @Options: 'hda-micro' (default: speaker/mic), 'hda-duplex' (line-in/line-out), 'hda-output' (output-only)" echo " --extra_args : Pass additional arguments to qemu" echo " --version : Print version" - exit 1 } function display_param_check() { @@ -1921,6 +1920,7 @@ fi # Take command line arguments if [ $# -lt 1 ]; then usage + exit 1 else while [ $# -gt 0 ]; do case "${1}" in @@ -2066,10 +2066,12 @@ else echo "${VERSION}" exit;; -h|--h|-help|--help) - usage;; + usage + exit 0;; *) echo "ERROR! \"${1}\" is not a supported parameter." - usage;; + usage + exit 1;; esac done fi @@ -2134,12 +2136,14 @@ if [ -n "${VM}" ] && [ -e "${VM}" ]; then exit;; *) echo "ERROR! \"${SNAPSHOT_ACTION}\" is not a supported snapshot action." - usage;; + usage + exit 1;; esac fi else echo "ERROR! Virtual machine configuration not found." usage + exit 1 fi display_param_check