From 1f9c0dab85e3c4cceb984a968753533ceeed7f84 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Mon, 2 Oct 2023 09:03:31 +0200 Subject: [PATCH] improving arg handling and messages --- cleanup_pr.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cleanup_pr.sh b/cleanup_pr.sh index 0be769bd..41527675 100755 --- a/cleanup_pr.sh +++ b/cleanup_pr.sh @@ -76,8 +76,8 @@ done # restore potentially parsed filename(s) into $* set -- "${POSITIONAL_ARGS[@]}" -if [[ $# -lt 1 ]]; then - echo "Error: no PR number provided" +if [[ $# -ne 1 ]]; then + echo "Error: exactly one PR number should be provided as argument" display_help exit 3 fi @@ -127,6 +127,7 @@ do if ${dry_run} = true ; then echo "DRY_RUN: rm '$f' ($(ls -lh $f | awk '{print $5}'))" else + echo "Removing file '$f'" rm $f fi done @@ -145,6 +146,7 @@ do if ${dry_run} = true ; then echo "DRY_RUN: rm '$f' ($(ls -lh $f | awk '{print $5}'))" else + echo "Removing file '$f'" rm $f fi done