From b441b73b0696c254fee335d6de9ad19065398563 Mon Sep 17 00:00:00 2001 From: Kim Date: Tue, 21 Sep 2021 21:08:59 +0200 Subject: [PATCH] fix usage --- .drone.yml | 2 +- trash.sh | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index a32fbfc..183407b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -77,4 +77,4 @@ steps: pull: if-not-exists commands: - . $HOME/.bashrc - - trash || true \ No newline at end of file + - trash \ No newline at end of file diff --git a/trash.sh b/trash.sh index b4331af..e4515c8 100644 --- a/trash.sh +++ b/trash.sh @@ -11,7 +11,10 @@ usage() { local func_args=$1 local func_name="$2" - if [[ $func_args == 0 ]]; then echo -e "At least one argument required:\n$func_name FILE1 DIR2 ..."; exit 1; fi + if [[ $func_args == 0 ]]; + then echo -e "At least one argument required:\n$func_name FILE1 DIR2 ..." + exit + fi } trash_list() { @@ -19,7 +22,7 @@ trash_list() { } trash_put() { - usage "$#" "$0" + usage "$#" "${FUNCNAME[0]}" for FILE in $@; do # Store old filepath for later restore