Rearranged tree to be more sane. Made formatting changes to stage 2. Fixed a bug where edit would be bypassed if the note was just created.
31 lines
770 B
Bash
31 lines
770 B
Bash
# Help requires no arguments, and is exclusive.
|
|
if [ -n "$HELP" ]; then help; exit 0; fi
|
|
|
|
# List only requires a notebook, and is exclusive.
|
|
if [ -z "$NOTEBOOK" ]; then
|
|
echo " ERROR: Insufficient arguments:"
|
|
echo " Notebook not specified"
|
|
exit 30
|
|
fi
|
|
|
|
if [ -n "$LIST" ]; then
|
|
|
|
list
|
|
exit 0
|
|
fi
|
|
|
|
#All other functions require a note title and notebook.
|
|
|
|
if [ -z "$NAME" ]; then
|
|
echo " ERROR: Insufficient arguments:"
|
|
echo " Title not specified"
|
|
exit 30
|
|
fi
|
|
|
|
NOTEDIR=$BASEDIR/$NOTEBOOK/$SECTION/
|
|
NOTE=$NOTEDIR$NAME.$EXT
|
|
|
|
if [ "$ENCRYPTION" == "TRUE" ]; then NOTE=$NOTE.enc; fi
|
|
if [ "$PRINT" == "TRUE" ]; then print; exit 0; fi
|
|
if [ "$CREATE" == "TRUE" ]; then create; fi
|
|
if [ "$EDIT" == "TRUE" ]; then edit; fi |