summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xnew-doc7
1 files changed, 6 insertions, 1 deletions
diff --git a/new-doc b/new-doc
index 23fdadb..b11ac79 100755
--- a/new-doc
+++ b/new-doc
@@ -21,12 +21,17 @@ shopt -s extglob
now="$(TZ=UTC date +'%F %T')"
+force=0
+if [[ "$1" == "-f" ]]; then
+ force=1
+ shift
+fi
docname="$1"
shift
declare -a tags
tags=("$@")
-if [[ -d "$docname" ]]; then
+if [[ -d "$docname" && "$force" -ne 1 ]]; then
>&2 echo "\"$docname\" already exists"
exit 1
fi