danix
's git repository
home
/
my projects
/
bash-notes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
87a368f
)
removed the 'function' keyword before declaring a function as is not needed.
author
danix
<danix@danix.xyz>
Fri, 14 Apr 2023 07:32:15 +0000
(09:32 +0200)
committer
danix
<danix@danix.xyz>
Fri, 14 Apr 2023 07:32:15 +0000
(09:32 +0200)
SOURCE/CORE/core-add.sh
patch
|
blob
|
blame
|
history
SOURCE/CORE/core-backup.sh
patch
|
blob
|
blame
|
history
SOURCE/CORE/core-edit.sh
patch
|
blob
|
blame
|
history
SOURCE/CORE/core-list.sh
patch
|
blob
|
blame
|
history
SOURCE/CORE/core-remove.sh
patch
|
blob
|
blame
|
history
SOURCE/CORE/core-show.sh
patch
|
blob
|
blame
|
history
SOURCE/CORE/helpers.sh
patch
|
blob
|
blame
|
history
SOURCE/head.sh
patch
|
blob
|
blame
|
history
diff --git
a/SOURCE/CORE/core-add.sh
b/SOURCE/CORE/core-add.sh
index
ed6256c
..
1c71bbb
100644
(file)
--- 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
# 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
(file)
--- 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"
BACKUPDIR="$1"
echo "backing up data in $BACKUPDIR"
@@
-39,7
+39,7
@@
function backup_data() {
fi
}
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."
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
(file)
--- 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")
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
(file)
--- 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
# [ $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
(file)
--- 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
# 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
(file)
--- a/
SOURCE/CORE/core-show.sh
+++ b/
SOURCE/CORE/core-show.sh
@@
-1,4
+1,4
@@
-
function
shownote() {
+shownote() {
NOTE=$1
# shellcheck disable=SC2155
NOTE=$1
# shellcheck disable=SC2155
diff --git
a/SOURCE/CORE/helpers.sh
b/SOURCE/CORE/helpers.sh
index
567846b
..
b7b9180
100644
(file)
--- 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
# check if input is a number, returns false or the number itself
-
function
check_noteID() {
+check_noteID() {
IN=$1
case $IN in
''|*[!0-9]*)
IN=$1
case $IN in
''|*[!0-9]*)
@@
-11,7
+11,7
@@
function check_noteID() {
esac
}
esac
}
-
function
helptext() {
+helptext() {
echo "Usage:"
echo " $0 [PARAMS] [note ID]..."
echo ""
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."
}
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:
cat << __NOWCONF__
${BASENAME} configuration is:
@@
-52,7
+52,7
@@
__NOWCONF__
}
# this function returns a random 2 words title
}
# this function returns a random 2 words title
-
function
random_title() {
+random_title() {
# Constants
X=0
DICT=/usr/share/dict/words
# Constants
X=0
DICT=/usr/share/dict/words
diff --git
a/SOURCE/head.sh
b/SOURCE/head.sh
index
d609726
..
7b684f1
100644
(file)
--- a/
SOURCE/head.sh
+++ b/
SOURCE/head.sh
@@
-91,7
+91,7
@@
fi
echo $PID > "$PIDFILE"
# Export config to file
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)
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.
# we should expand on this function to add a sample note and explain a little bit
# how the program works.
-f
unction f
irstrun() {
+firstrun() {
[ -f $RCFILE ] && RC=$RCFILE || RC="none"
clear
[ -f $RCFILE ] && RC=$RCFILE || RC="none"
clear