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-------------------------------------------------------------------------
|
General-------------------------------------------------------------------------
|
||||||
ERR_NO_ARGS 10 No arguments were specified
|
ERR_NO_ARGS 10 No arguments were specified
|
||||||
ERR_NO_OP 20
|
ERR_NO_OP 20 No operation was specified
|
||||||
ERR_NO_NOTEBOOK 30 A required argument was not provided
|
ERR_NO_NOTE 30 A required argument was not provided
|
||||||
|
|
||||||
Encryption----------------------------------------------------------------------
|
Encryption----------------------------------------------------------------------
|
||||||
ERR_NO_GPG 100 Encryption is enabled, but GPG is not installed
|
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 TMP_DIR="\$ROOT_DIR"/tmp
|
||||||
readonly CONFIG_FILE="\$ROOT_DIR/sns.conf"
|
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" "\$PROD_STR"
|
||||||
printf "%s\n" "------------------"
|
printf "%s\n" "------------------"
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
# Entry Point
|
|
||||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# Stage 1: Read Configuration / Verify Integrity
|
# Stage 1: Read Configuration / Verify Integrity
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
if [ "$OP" != "TRUE" ]; then
|
if [ "$OP" != "TRUE" ]; then
|
||||||
help; exit 20
|
help; exit 20
|
||||||
fi
|
fi
|
||||||
# All options not requiring at least a notebook 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_NOTEBOOK.
|
# with; if one isn't specified, exit on ERR_NO_NOTE.
|
||||||
if [ -z "$NOTEBOOK" ]; then
|
if [ -z "$NOTE" ]; then
|
||||||
printf "\n%s\n %s\n" "ERROR: Insufficient arguments:" "Notebook not specified"
|
printf " $RED_COLOR!$RESET_COLOR %s\n" "No note specified."
|
||||||
exit 30
|
exit 30
|
||||||
fi
|
fi
|
||||||
# List is the only option requiring only a notebook.
|
# List is the only option requiring only a notebook.
|
||||||
|
|||||||
Reference in New Issue
Block a user