function helptext() {
echo "Usage:"
- echo " $0 [PARAMS] ..."
+ echo " $0 [PARAMS] [note ID]..."
echo ""
echo "${BASENAME} parameters are:"
echo -e " -h | --help\t\t\t: This help text"
echo -e " --userconf\t\t\t: Export User config file"
echo -e " --backup [<dest>]\t\t: Backup your data in your destination folder"
echo ""
+ echo -e "if a non option is passed and is a valid note ID, the note will be displayed."
}
function configtext() {
if [ ! "$OK" ]; then
echo "invalid note \"$NOTE\""
echo "Use the note ID that you can fetch after listing your notes"
+ sleep 1
exit 1
fi
mv $TMPDB $DB
rm $NOTESDIR/$FILE
echo "Deleted note $TITLE"
+ sleep 1
+ exit
else
echo "note not found"
+ sleep 1
exit 1
fi
fi
;;
esac
done
+
+for arg; do
+ if [ $(check_noteID $arg) ]; then
+ shownote $arg
+ else
+ helptext
+ exit
+ fi
+done