feat: Add function to show nice help message

This commit is contained in:
zen0bit 2024-04-12 18:16:05 +02:00 committed by Martin Wimpress
parent 626c63cb7e
commit c703f8518e
1 changed files with 47 additions and 0 deletions

View File

@ -3694,6 +3694,53 @@ if [[ ! " $(os_support) " =~ " ${OS} " ]]; then
echo -e "ERROR! ${OS} is not a supported OS.\n" echo -e "ERROR! ${OS} is not a supported OS.\n"
os_support os_support
exit 1 exit 1
help_message() {
#shellcheck disable=SC2016
printf ' _ _
__ _ _ _ _ ___║ ║ ____ _ ___║ ║_
/ _` ║ ║ ║ ║ ║/ __║ ║/ / _` ║/ _ \ __║
( (_║ ║ ║_║ ║ ║ (__║ < (_║ ║ __/ ║_ MIT
\__, ║\__,_║_║\___║_║\ \__, ║\___║\__║ license
║_║ version: %s ║___/ part of QUICKEMU project
QEMU %s --------------------------------------------------
> Quickly create and run optimised Linux, <
> Windows and macOS desktop virtual machines. <
homepage - Not Yet
repository - https://github.com/quickemu-project/quickemu
official GUI - https://github.com/quickemu-project/quickgui
by Wimpy https://github.com/flexiondotorg and contributors
Discord - https://discord.gg/wimpy-s-world-712850672223125565
--------------------------------------------------------------
Basic Usage:
quickget <os> <release> [edition]
quickget alpine latest
Advanced Usage:
quickget <arg> [path] <os> [re] [ed]
quickget -d peppermint latest devuan-xfce
Posible arguments:
--help (-h) : Show this help message and exit
--os-info (-i) <os> : Show info about OS
--os-homepage (-o) <os> : Open OS homepage in default browser
--iso-download (-d) <os> <re> [ed] : Just download ISO
--custom (-c) <os> <ISO path>: Create VM with downloaded ISO*
--version (-v) : Show version and exit
* To prepare custom VM config (Not supported by quickget) use:
quickget --custom <some name> <path to ISO>
-------------- for developers / testing ----------------------
--list-json (-lj) : Show OS info in json format
--list-csv (-lc) : Show OS info in csv format
--list-supported (-ls) : List all supported OS,releases,editions
--list-isos (-li) : List all supported ISOs
--test-isos (-ti) : Test if ISOs are available
--------------------------------------------------------------
supported Operating Systems:\n' "$(quickemu --version)" "$(qemu-x86_64 -version | head -1 | cut -d' ' -f3)"
os_support | fold -s -w "$(tput cols)"
exit 0
}
fi fi
if [ -n "${2}" ]; then if [ -n "${2}" ]; then