From b1e2a0183a9b5b587968f2ab77ac5952331d1972 Mon Sep 17 00:00:00 2001 From: danix Date: Fri, 14 Apr 2023 09:32:15 +0200 Subject: [PATCH] removed the 'function' keyword before declaring a function as is not needed. --- SOURCE/CORE/core-add.sh | 2 +- SOURCE/CORE/core-backup.sh | 4 ++-- SOURCE/CORE/core-edit.sh | 2 +- SOURCE/CORE/core-list.sh | 2 +- SOURCE/CORE/core-remove.sh | 2 +- SOURCE/CORE/core-show.sh | 2 +- SOURCE/CORE/helpers.sh | 8 ++++---- SOURCE/head.sh | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/SOURCE/CORE/core-add.sh b/SOURCE/CORE/core-add.sh index ed6256c..1c71bbb 100644 --- a/SOURCE/CORE/core-add.sh +++ b/SOURCE/CORE/core-add.sh @@ -1,4 +1,4 @@ -function addnote() { +addnote() { # remove eventually existing temp DB file if [[ -f $TMPDB ]]; then rm $TMPDB diff --git a/SOURCE/CORE/core-backup.sh b/SOURCE/CORE/core-backup.sh index 25f67c9..7a0b6d1 100644 --- a/SOURCE/CORE/core-backup.sh +++ b/SOURCE/CORE/core-backup.sh @@ -1,4 +1,4 @@ -function backup_data() { +backup_data() { BACKUPDIR="$1" echo "backing up data in $BACKUPDIR" @@ -39,7 +39,7 @@ function backup_data() { fi } -function backup_restore() { +backup_restore() { BACKUPDIR="$1" echo "restoring backup from $BACKUPDIR" echo "This will overwrite all your notes and configurations with the backup." diff --git a/SOURCE/CORE/core-edit.sh b/SOURCE/CORE/core-edit.sh index c42e63d..20765f1 100644 --- a/SOURCE/CORE/core-edit.sh +++ b/SOURCE/CORE/core-edit.sh @@ -1,4 +1,4 @@ -function editnote() { +editnote() { NOTE=$1 # shellcheck disable=SC2155 local OK=$(check_noteID "$NOTE") diff --git a/SOURCE/CORE/core-list.sh b/SOURCE/CORE/core-list.sh index 0580df3..17349cd 100644 --- a/SOURCE/CORE/core-list.sh +++ b/SOURCE/CORE/core-list.sh @@ -1,4 +1,4 @@ -function listnotes() { +listnotes() { # [ $PLAIN == true ] && echo "output is plain text" || echo "output is colored" if [[ $(ls -A "$NOTESDIR") ]]; then if [ $PLAIN == false ]; then diff --git a/SOURCE/CORE/core-remove.sh b/SOURCE/CORE/core-remove.sh index 0111d0f..7bbf8c4 100644 --- a/SOURCE/CORE/core-remove.sh +++ b/SOURCE/CORE/core-remove.sh @@ -1,4 +1,4 @@ -function rmnote() { +rmnote() { # remove eventually existing temp DB file if [[ -f $TMPDB ]]; then rm $TMPDB diff --git a/SOURCE/CORE/core-show.sh b/SOURCE/CORE/core-show.sh index 1a04c82..ac02c6b 100644 --- a/SOURCE/CORE/core-show.sh +++ b/SOURCE/CORE/core-show.sh @@ -1,4 +1,4 @@ -function shownote() { +shownote() { NOTE=$1 # shellcheck disable=SC2155 diff --git a/SOURCE/CORE/helpers.sh b/SOURCE/CORE/helpers.sh index 567846b..b7b9180 100644 --- a/SOURCE/CORE/helpers.sh +++ b/SOURCE/CORE/helpers.sh @@ -1,5 +1,5 @@ # check if input is a number, returns false or the number itself -function check_noteID() { +check_noteID() { IN=$1 case $IN in ''|*[!0-9]*) @@ -11,7 +11,7 @@ function check_noteID() { esac } -function helptext() { +helptext() { echo "Usage:" echo " $0 [PARAMS] [note ID]..." echo "" @@ -33,7 +33,7 @@ function helptext() { echo -e "if a non option is passed and is a valid note ID, the note will be displayed." } -function configtext() { +configtext() { cat << __NOWCONF__ ${BASENAME} configuration is: @@ -52,7 +52,7 @@ __NOWCONF__ } # this function returns a random 2 words title -function random_title() { +random_title() { # Constants X=0 DICT=/usr/share/dict/words diff --git a/SOURCE/head.sh b/SOURCE/head.sh index d609726..7b684f1 100644 --- a/SOURCE/head.sh +++ b/SOURCE/head.sh @@ -91,7 +91,7 @@ fi echo $PID > "$PIDFILE" # Export config to file -function export_config() { +export_config() { if [ -r ${RCFILE} ]; then echo "Backing up current '${RCFILE}'...." mv -f ${RCFILE} ${RCFILE}.$(date +%Y%m%d_%H%M) @@ -112,7 +112,7 @@ function export_config() { # we should expand on this function to add a sample note and explain a little bit # how the program works. -function firstrun() { +firstrun() { [ -f $RCFILE ] && RC=$RCFILE || RC="none" clear -- 2.20.1