aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/wiki/diary17
1 files changed, 12 insertions, 5 deletions
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() {
19 vim -c 'Goyo' $FILE 19 vim -c 'Goyo' $FILE
20} 20}
21 21
22print_today() {
23 cat ~/vimwiki/diary/$(date --iso-8601).md
24}
25
22add_entry() { 26add_entry() {
23 set -x 27 set -x
24 echo - "$@" >>~/vimwiki/diary/$(date --iso-8601).md 28 echo - "$@" >>~/vimwiki/diary/$(date --iso-8601).md
25 set +x 29 set +x
26} 30}
27 31
28if [ $# -eq 0 ]; then 32case "$1" in
29 pick_date 33 "")
30else 34 pick_date ;;
31 add_entry "$@" 35 p)
32fi 36 print_today ;;
37 *)
38 add_entry "$@" ;;
39esac