From 1aaaf60b2d8874010fb87e6c7ae9d908d6f552c0 Mon Sep 17 00:00:00 2001 From: BonzaiBrains <133261117+BonzaiBrains@users.noreply.github.com> Date: Thu, 31 Oct 2024 13:01:37 +0100 Subject: [PATCH] add: usage function --- shemum | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/shemum b/shemum index e9bf6e4..6036d6f 100755 --- a/shemum +++ b/shemum @@ -65,6 +65,7 @@ console_func function { -m $RAM -smp $CPU } +# Virtual machine initialization with a console init_func function { mkdir -p "$ROOT_PATH/$OS_NAME" qemu-img create $IMG_PATH $DISK_SIZE @@ -84,6 +85,15 @@ init_func function { -m $RAM -smp $CPU } +# Display usage +usage_func function { + printf "Usage: shemum [init] " + printf " init initialize a virtual machine" + printf " start start a QEMU virtual machine without console output" + printf " console start a QEMU virtual machine with console output" + printf " remove remove virtual machine directory and all it's contents" +} + # Options case $OPTION in # Initializes the VM and starts the installer image. @@ -100,11 +110,7 @@ case $OPTION in remove_func ;; *) - echo "Usage: shemum [init] " - echo " init initialize a virtual machine" - echo " start start a QEMU virtual machine without console output" - echo " console start a QEMU virtual machine with console output" - echo " remove remove virtual machine directory and all it's contents" + usage_func esac