when creating a note, if the title is not specified, two random words will be assigne...
[bash-notes.git] / SOURCE / CORE / core-add.sh
index aa9d451..ed6256c 100644 (file)
@@ -4,7 +4,8 @@ function addnote() {
                rm $TMPDB
        fi
 
-       NOTETITLE="$1"
+       RTITLE=$(random_title)
+       [[ -z "$1" ]] && NOTETITLE="$RTITLE" || NOTETITLE="$1"
        echo "adding new note - \"$NOTETITLE\""
        # shellcheck disable=SC2086
        LASTID=$($JQ '.notes[-1].id // 0 | tonumber' $DB)