From 0da48d73b042a6556b6b1979bdeaec988065af1a Mon Sep 17 00:00:00 2001 From: zen0bit Date: Mon, 29 Apr 2024 12:04:47 +0200 Subject: [PATCH] fix: add not_supported_argument() --- quickget | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/quickget b/quickget index 92edc86..7c82345 100755 --- a/quickget +++ b/quickget @@ -146,7 +146,7 @@ function show_os_info() { while getopts ":12345" opt; do case $opt in 1|2|3|4|5) os_info "${2}" | cut -d'|' -f${opt};; - *) echo "Wrong choice!" && exit 1;; + *) error_not_supported_argument;; esac done } @@ -253,6 +253,13 @@ function error_not_supported_lang() { exit 1 } +function error_not_supported_argument() { + echo "ERROR! Not supported argument" + echo "To see all possible arguments, use:" + echo " quickget -h or quickget --help" + exit 1 +} + function handle_missing() { # Handle odd missing Fedora combinations case "${OS}" in @@ -3431,6 +3438,9 @@ case "${1}" in '--list'|'-l') list_supported ;; + -*) + error_not_supported_argument + ;; esac if [ -n "${1}" ]; then