Still heavily broken; moving computers again

This commit is contained in:
Jon-William Lewis
2016-08-27 15:08:15 -05:00
parent 704980fa2b
commit 4966351673
6 changed files with 634 additions and 37 deletions

View File

@@ -55,6 +55,10 @@ if [ "$ENCRYPTION" == "TRUE" ]; then
fi
done
fi
# Set the extension to denote encryption.
declare -r EXT=gpg.note
SESSION_ID="$RANDOM" #SESSION_ID later becomes the temporary filename
# If encryption isn't enabled, make sure either all notes are decrypted or the user
# does not wish to decrypt all notes.
else
@@ -90,19 +94,23 @@ else
done
fi
fi
# Set the extension
declare -r EXT=note
fi
#==============================================================================
# Stage 2: Argument Parsing
#==============================================================================
if [ -z "$1" ]; then help; exit 20
else
ARGS="$@"
ARGS=("${@}")
declare -i INDEX
INDEX=0
while getopts ":cCd:e:lp:hi" ARG $VCTL; do
let INDEX++
case "$ARG" in
c|--create)
NOTE="$ARGOPT" create
CREATE="TRUE"
OP="TRUE"
;;
@@ -116,21 +124,23 @@ else
exit 0;
;;
d|--delete)
NOTE="$ARGOPT" delete
DELETE="TRUE"
OP="TRUE"
;;
e|--edit)
NOTE="${ARGS[$INDEX]}" edit
EDIT="TRUE"
OP="TRUE"
;;
l|--list)
echo "${ARGS[$INDEX]}"
NOTEBOOK="${ARGS[$INDEX]}"
NOTEBOOK="${ARGS[$INDEX]}" list
exit 0
LIST="TRUE"
OP="TRUE"
;;
p|--print)
NOTE="${ARGS[$INDEX]}" print
PRINT="TRUE"
OP="TRUE"
;;
@@ -169,12 +179,7 @@ fi
# exit 30
#fi
if [ "$ENCRYPTION" == "TRUE" ]; then
SESSION_ID="$RANDOM" #SESSION_ID later becomes the temporary filename
readonly NOTE="$NOTE.gpg.$EXT"
else
readonly NOTE="$NOTE.$EXT"
fi
if [ "$LIST" == "TRUE" ]; then list ; exit 0; fi
if [ "$PRINT" == "TRUE" ]; then print ; exit 0; fi