From 8bd3a165de2b894bd81cb090812a01a0360fd5f4 Mon Sep 17 00:00:00 2001 From: mprov Date: Thu, 28 Jan 2021 17:11:03 -0800 Subject: [PATCH 1/2] added --help, help verbage, and structure for future argument handling. --- lug-helper.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lug-helper.sh b/lug-helper.sh index ad2cf9d..c99a955 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -45,6 +45,21 @@ # https://github.com/richardtatum/sc-runner-updater ############################################################################ +# Nobody expects the spanish inquisition. +while [ $# -gt 0 ] +do + opt="${1}" + case "${opt}" in + --help|-h|-? ) + printf "\n$0: There are currently no command line arguments, this is actually a GUI script.\nRun this command again without any arguments.\n\n" + exit 0 + ;; + * ) + ;; + esac + shift; +done + # Check for dependencies if [ ! -x "$(command -v curl)" ]; then # Print to stderr and also try warning the user through notify-send From 1d4ff8375e2576236d0f6eeb9249fa8e2993a319 Mon Sep 17 00:00:00 2001 From: mprov Date: Thu, 28 Jan 2021 17:50:58 -0800 Subject: [PATCH 2/2] subtraction of abstraction --- lug-helper.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index c99a955..f0e81e1 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -48,8 +48,7 @@ # Nobody expects the spanish inquisition. while [ $# -gt 0 ] do - opt="${1}" - case "${opt}" in + case "$1" in --help|-h|-? ) printf "\n$0: There are currently no command line arguments, this is actually a GUI script.\nRun this command again without any arguments.\n\n" exit 0