From 55a29d21536323bf66ef57e8592a8299dc2b0dad Mon Sep 17 00:00:00 2001 From: schizoid Date: Mon, 9 Dec 2024 11:53:26 -0500 Subject: Added input checking function --- archive-dl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/archive-dl b/archive-dl index 229ec9d..cbf4b93 100755 --- a/archive-dl +++ b/archive-dl @@ -3,14 +3,19 @@ input=$1 type=$2 -check() -if [ -n "$input" ]; then +# This is a function: +# It checks if the user has input data. +check() { +if [ -n "$1" ]; then echo else - echo "Please enter URL"; + echo "Please enter URL/File type."; exit 0 fi +} +check $input +check $type echo $input echo $type -- cgit v1.2.3