]> danix's work - bash-notes.git/commitdiff
removed the 'function' keyword before declaring a function as is not needed.
authordanix <redacted>
Fri, 14 Apr 2023 07:32:15 +0000 (09:32 +0200)
committerdanix <redacted>
Fri, 14 Apr 2023 07:32:15 +0000 (09:32 +0200)
SOURCE/CORE/core-add.sh
SOURCE/CORE/core-backup.sh
SOURCE/CORE/core-edit.sh
SOURCE/CORE/core-list.sh
SOURCE/CORE/core-remove.sh
SOURCE/CORE/core-show.sh
SOURCE/CORE/helpers.sh
SOURCE/head.sh

index ed6256c373286d32ce396ed5bcc84848cd96405a..1c71bbbf4464d93d38160225b1376b7bbfeeda54 100644 (file)
@@ -1,4 +1,4 @@
-function addnote() {
+addnote() {
        # remove eventually existing temp DB file
        if [[ -f $TMPDB ]]; then
                rm $TMPDB
index 25f67c9199f875d339b2c85be1f922c381228a8c..7a0b6d119172cb0e4a50e9c560755554f60d6f11 100644 (file)
@@ -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."
index c42e63dff831605c50b39ffdf0dcffb421c5fec5..20765f1a390b90afc68935c8780bcc837308599e 100644 (file)
@@ -1,4 +1,4 @@
-function editnote() {
+editnote() {
        NOTE=$1
        # shellcheck disable=SC2155
        local OK=$(check_noteID "$NOTE")
index 0580df345482a6d9b02c3742296aa29801395400..17349cdb41b157dbf482a6bd7ab239e8edbd9b9d 100644 (file)
@@ -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
index 0111d0fe7f264326d641e6a6c229e60017e2af5a..7bbf8c40a5ce620f6116fdd1c918dce74be196e4 100644 (file)
@@ -1,4 +1,4 @@
-function rmnote() {
+rmnote() {
        # remove eventually existing temp DB file
        if [[ -f $TMPDB ]]; then
                rm $TMPDB
index 1a04c8222e995d3e8260fb52dc3002ab4fc3d699..ac02c6b580d3df1cfaa4aa76448d8959b470ebb9 100644 (file)
@@ -1,4 +1,4 @@
-function shownote() {
+shownote() {
        NOTE=$1
 
        # shellcheck disable=SC2155
index 567846b04033d148b4f9065f71f6df5f34824cde..b7b9180d388434cfe8cb7dc11bebd46abad03e3d 100644 (file)
@@ -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
index d609726835fd6e2bf27dfc73b3f370a68a6c2789..7b684f11640a3975c463718db5cfe27b2145b2e7 100644 (file)
@@ -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