From 7184fb6ed0ed6b75f836450507b49290de7bdfdd Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Tue, 26 Apr 2022 23:05:06 +0800 Subject: Update --- tools/wiki/diary | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'tools/wiki') diff --git a/tools/wiki/diary b/tools/wiki/diary index 06124bd..c82f040 100755 --- a/tools/wiki/diary +++ b/tools/wiki/diary @@ -19,14 +19,21 @@ pick_date() { vim -c 'Goyo' $FILE } +print_today() { + cat ~/vimwiki/diary/$(date --iso-8601).md +} + add_entry() { set -x echo - "$@" >>~/vimwiki/diary/$(date --iso-8601).md set +x } -if [ $# -eq 0 ]; then - pick_date -else - add_entry "$@" -fi +case "$1" in + "") + pick_date ;; + p) + print_today ;; + *) + add_entry "$@" ;; +esac -- cgit v1.2.3-70-g09d2