summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwd10
1 files changed, 9 insertions, 1 deletions
diff --git a/wd b/wd
index 1a2e1f2..5880f98 100755
--- a/wd
+++ b/wd
@@ -7,6 +7,7 @@ PROGRAM="$(basename $0)"
WD_NOTES_DIR=${WD_NOTES_DIR:-"$HOME/notes"}
WD_JOURNALS_DIR=${WD_JOURNALS_DIR:-"$WD_NOTES_DIR/journals"}
+WD_INDEX_FILE=${WD_INDEX_FILE:-index.md}
WD_DEFAULT_SUBCOMMAND=${WD_DEFAULT_SUBCOMMAND:-help}
year=$(date +%Y)
@@ -31,7 +32,14 @@ cmd_version () {
}
cmd_edit () {
- $EDITOR "$WD_NOTES_DIR/index.md"
+ local file
+ if [ "$#" -eq 0 ]; then
+ file="$WD_INDEX_FILE"
+ else
+ file="$1"
+ fi
+
+ $EDITOR "$WD_NOTES_DIR/$file"
exit 0
}