From 8a6e42f0c8683dc8f0fd133309c94bbce43a0879 Mon Sep 17 00:00:00 2001 From: kevinnls <57634663+kevinnls@users.noreply.github.com> Date: Tue, 16 Mar 2021 20:11:34 +0530 Subject: [PATCH] configure bak-old to print usage when no args are passed --- bak-old.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bak-old.sh b/bak-old.sh index 3721a0e..cf174d8 100755 --- a/bak-old.sh +++ b/bak-old.sh @@ -188,6 +188,10 @@ ${DEBUG+debug} ### ############################################################################### # SANITISING PARAMS AND OPTIONS ################################## +if [[ $# -eq 0 ]]; then + print_usage +fi + while [[ $# -gt 0 ]]; do case $1 in '-h' ) @@ -239,10 +243,10 @@ done deps=(realpath) for dep in $deps; do - if command -v "$dep"; then - continue + if command -v "$dep" >/dev/null; then + continue else - missing=":${dep}" + missing=":${dep}" fi done