mirror of
https://codeberg.org/privacy1st/arch-installer
synced 2024-12-23 02:16:05 +01:00
16 lines
313 B
Bash
16 lines
313 B
Bash
|
function validate_args(){
|
||
|
local num_args="${1}"
|
||
|
shift
|
||
|
|
||
|
if [ "$#" -ne "${num_args}" ]; then
|
||
|
printf '%s\n' "ERROR: ${num_args} arguments required"
|
||
|
return 1
|
||
|
fi
|
||
|
for i in "$@"; do
|
||
|
if [ -z "${i}" ]; then
|
||
|
printf '%s\n' 'ERROR: All given args must not be empty'
|
||
|
return 1
|
||
|
fi
|
||
|
done
|
||
|
}
|