Continued work on loosening note definition; added framework for color in errors.
This commit is contained in:
@@ -3,8 +3,8 @@ Error Code Reference
|
||||
|
||||
General-------------------------------------------------------------------------
|
||||
ERR_NO_ARGS 10 No arguments were specified
|
||||
ERR_NO_OP 20
|
||||
ERR_NO_NOTEBOOK 30 A required argument was not provided
|
||||
ERR_NO_OP 20 No operation was specified
|
||||
ERR_NO_NOTE 30 A required argument was not provided
|
||||
|
||||
Encryption----------------------------------------------------------------------
|
||||
ERR_NO_GPG 100 Encryption is enabled, but GPG is not installed
|
||||
|
||||
@@ -19,6 +19,9 @@ readonly NOTES_DIR="\$ROOT_DIR"/notes
|
||||
readonly TMP_DIR="\$ROOT_DIR"/tmp
|
||||
readonly CONFIG_FILE="\$ROOT_DIR/sns.conf"
|
||||
|
||||
readonly RED_COLOR='\033[1;31m'
|
||||
readonly RESET_COLOR='\033[0m'
|
||||
|
||||
printf "%s\n" "\$PROD_STR"
|
||||
printf "%s\n" "------------------"
|
||||
EOF
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# Entry Point
|
||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
#==============================================================================
|
||||
# Stage 1: Read Configuration / Verify Integrity
|
||||
#==============================================================================
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
if [ "$OP" != "TRUE" ]; then
|
||||
help; exit 20
|
||||
fi
|
||||
# All options not requiring at least a notebook to be specified have been dealt
|
||||
# with; if one isn't specified, exit on ERR_NO_NOTEBOOK.
|
||||
if [ -z "$NOTEBOOK" ]; then
|
||||
printf "\n%s\n %s\n" "ERROR: Insufficient arguments:" "Notebook not specified"
|
||||
# All options not requiring a note to be specified have been dealt
|
||||
# with; if one isn't specified, exit on ERR_NO_NOTE.
|
||||
if [ -z "$NOTE" ]; then
|
||||
printf " $RED_COLOR!$RESET_COLOR %s\n" "No note specified."
|
||||
exit 30
|
||||
fi
|
||||
# List is the only option requiring only a notebook.
|
||||
|
||||
Reference in New Issue
Block a user