Temporary commit (moving computers)

This commit is contained in:
Jon Lewis
2016-08-27 14:27:44 -05:00
parent c709d3e8fb
commit 704980fa2b
2 changed files with 15 additions and 8 deletions

View File

@@ -152,7 +152,10 @@ function help {
} }
function list(){ function list(){
# This function, given a folder, $NOTE, will list the contents of $NOTE. # This function, given a folder, $NOTE, will list the contents of $NOTE.
cd "$(dirname "$NOTES_DIR/$NOTE")" # If not given a folder, it will list all notes in the store.
if [ -z "$NOTEBOOK" ]; then NOTEBOOK="."; fi
cd "$(dirname "$NOTES_DIR/$NOTEBOOK")"
find . -type f -name "*$EXT" | while read file; do find . -type f -name "*$EXT" | while read file; do
printf "%s\n" "$file" printf "%s\n" "$file"
done done

View File

@@ -94,11 +94,12 @@ fi
#============================================================================== #==============================================================================
# Stage 2: Argument Parsing # Stage 2: Argument Parsing
#============================================================================== #==============================================================================
NOTE=""
if [ -z "$1" ]; then help; exit 20 if [ -z "$1" ]; then help; exit 20
else else
ARGS="$@"
declare -i INDEX
INDEX=0 INDEX=0
while getopts ":cCd:xe:xl:xp:xhi" ARG $VCTL; do while getopts ":cCd:e:lp:hi" ARG $VCTL; do
let INDEX++ let INDEX++
case "$ARG" in case "$ARG" in
c|--create) c|--create)
@@ -123,7 +124,10 @@ else
OP="TRUE" OP="TRUE"
;; ;;
l|--list) l|--list)
LIST="TRUE" echo "${ARGS[$INDEX]}"
NOTEBOOK="${ARGS[$INDEX]}"
LIST="TRUE"
OP="TRUE" OP="TRUE"
;; ;;
p|--print) p|--print)
@@ -160,10 +164,10 @@ fi
fi fi
# All options not requiring a note to be specified have been dealt # All options not requiring a note to be specified have been dealt
# with; if one isn't specified, exit on ERR_NO_NOTE. # with; if one isn't specified, exit on ERR_NO_NOTE.
if [ -z "$NOTE" ]; then #if [ -z "$NOTE" ]; then
printf "$RED_COLOR!$RESET_COLOR %s\n" "No note specified." # printf "$RED_COLOR!$RESET_COLOR %s\n" "No note specified."
exit 30 # exit 30
fi #fi
if [ "$ENCRYPTION" == "TRUE" ]; then if [ "$ENCRYPTION" == "TRUE" ]; then
SESSION_ID="$RANDOM" #SESSION_ID later becomes the temporary filename SESSION_ID="$RANDOM" #SESSION_ID later becomes the temporary filename