From ba0a349e104e3130952699c4a8b6b71c5193dff7 Mon Sep 17 00:00:00 2001 From: Kim Date: Tue, 21 Sep 2021 21:24:04 +0200 Subject: [PATCH] fix usage --- trash.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/trash.sh b/trash.sh index b7bf7fb..4415e58 100644 --- a/trash.sh +++ b/trash.sh @@ -22,8 +22,7 @@ trash_list() { } trash_put() { - echo "$FUNCNAME" - usage "$#" "${FUNCNAME[0]}" + usage "$#" "trash_put" for FILE in $@; do # Store old filepath for later restore @@ -38,7 +37,7 @@ trash_empty() { } trash_restore() { - usage "$#" "${FUNCNAME[0]}" + usage "$#" "trash_restore" for FILE_TO_RESTORE in "$@"; do # Get old filepath for restore @@ -53,8 +52,7 @@ trash_restore() { } trash_rm() { - usage "$#" "${FUNCNAME[0]}" - #if [[ $# == 0 ]]; then echo -e "At least one argument required:\n$0 FILE1 DIR2 ..."; return 1; fi + usage "$#" "trash_rm" for FILE_TO_REMOVE in "$@"; do if ! echo "$FILE_TO_REMOVE" | grep "$HOME/.trash"