From c3d50af36ea2d1b8ac6e9b7c6568dc04db3461d6 Mon Sep 17 00:00:00 2001 From: z3rOR0ne Date: Tue, 20 Dec 2022 00:36:21 -0800 Subject: [PATCH] :lipstick: Added simple arg check and reformatted --- scripts/dye | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/dye b/scripts/dye index 6d808753..2f3cd58d 100755 --- a/scripts/dye +++ b/scripts/dye @@ -17,7 +17,7 @@ # along with this program. If not, see . printhelp() { -cat << EOM + cat < /dev/null ; then + for dep in "$@"; do + if ! command -v "$dep" &>/dev/null; then error "dependency not met: $dep" fi done - if [[ $missingdependencies -gt 0 ]] ; then + if [[ $missingdependencies -gt 0 ]]; then exit 1 fi } main() { + if [[ "$#" -lt 1 ]]; then + printhelp + fi + while getopts ":x:r:?" arg; do case $arg in x)