diff options
-rwxr-xr-x | wd | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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 } |