refactor: clean up extra_args variables

This commit is contained in:
Martin Wimpress 2024-05-12 23:31:47 +01:00 committed by Martin Wimpress
parent 116c35a0c6
commit 7f877d108b
1 changed files with 4 additions and 8 deletions

View File

@ -1284,12 +1284,9 @@ function vm_boot() {
exit 1 exit 1
fi fi
if [ -z "${EXTRA_ARGS}" ]; then if [ -n "${extra_args}" ]; then
EXTRA_ARGS="${extra_args}"
fi
if [ -n "${EXTRA_ARGS}" ]; then
# shellcheck disable=SC2206 # shellcheck disable=SC2206
args+=(${EXTRA_ARGS}) args+=(${extra_args})
fi fi
# The OSK parameter contains parenthesis, they need to be escaped in the shell # The OSK parameter contains parenthesis, they need to be escaped in the shell
@ -1537,7 +1534,7 @@ disk_img=""
disk_format="${disk_format:-qcow2}" disk_format="${disk_format:-qcow2}"
disk_size="" disk_size=""
display="" display=""
extra_args="" extra_args="${extra_args:-}"
fixed_iso="" fixed_iso=""
floppy="" floppy=""
guest_os="linux" guest_os="linux"
@ -1610,7 +1607,6 @@ KEYBOARD=""
KEYBOARD_LAYOUT="" KEYBOARD_LAYOUT=""
MOUSE="" MOUSE=""
USB_CONTROLLER="" USB_CONTROLLER=""
EXTRA_ARGS=""
SOUND_CARD="" SOUND_CARD=""
# shellcheck disable=SC2155 # shellcheck disable=SC2155
@ -1763,7 +1759,7 @@ else
shift; shift;
shift;; shift;;
-extra_args|--extra_args) -extra_args|--extra_args)
EXTRA_ARGS="${2}" extra_args+="${2}"
shift; shift;
shift;; shift;;
-sound-card|--sound-card) -sound-card|--sound-card)